Files
danbooru/app/helpers/artists_helper.rb
evazion 0793beded9 alias_and_implication_list: refactor alias/implication lookup.
Add alias and implications associations to Tag. Use them in
alias_and_implication list instead of duplicating the alias/implication
lookup code.
2017-03-23 02:47:21 -05:00

22 lines
556 B
Ruby

module ArtistsHelper
def artist_alias_and_implication_list(artist)
alias_and_implication_list(artist.tag)
end
def link_to_artist(name)
artist = Artist.find_by_name(name)
if artist
link_to(artist.name, artist_path(artist))
else
link_to(name, new_artist_path(:name => name)) + " " + content_tag("span", "*", :class => "new-artist", :title => "No artist with this name currently exists.")
end
end
def link_to_artists(names)
names.map do |name|
link_to_artist(name)
end.join(", ").html_safe
end
end