artists/summary: link other names to artist searches.

* Link other names to artist searches instead of to the new artist page.
* Remove the asterisk next to other names indicating the name isn't used
  as the primary name of another artist. This is almost always the case.
This commit is contained in:
evazion
2020-02-08 18:35:16 -06:00
parent 4ed716e90d
commit 3ef4d9c7ac
4 changed files with 16 additions and 28 deletions

View File

@@ -1,17 +0,0 @@
module ArtistsHelper
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(artist: {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