Refactor to use accepts_nested_attributes_for instead of the notes attribute to facilitate editing wikis on the artist edit page. This fixes the notes attribute unintentionally showing up in the API. This also changes it so that renaming an artist entry doesn't automatically rename the corresponding wiki page. This had bad behavior when there was a conflict between wiki pages (the wikis would be silently merged, which usually isn't what you want). It also didn't warn about wiki links being broken by renames.
14 lines
785 B
Plaintext
14 lines
785 B
Plaintext
<%= edit_form_for(@artist) do |f| %>
|
|
<%= f.input :name, as: :string, input_html: { "data-autocomplete": "tag" } %>
|
|
|
|
<%= f.input :other_names_string, label: "Other names", as: :text, input_html: { size: "50x1" }, hint: '<b style="color: red;">NEW</b> Separate names with spaces, not commas. Use underscores for spaces inside names.'.html_safe %>
|
|
<%= f.input :group_name %>
|
|
<%= f.input :url_string, :label => "URLs", :as => :text, :input_html => {:size => "50x15", :value => params.dig(:artist, :url_string) || @artist.urls.join("\n")}, :hint => "You can prefix a URL with - to mark it as dead." %>
|
|
|
|
<%= f.simple_fields_for :wiki_page do |fw| %>
|
|
<%= fw.input :body, label: "Wiki", input_html: { size: "50x15" } %>
|
|
<% end %>
|
|
|
|
<%= f.button :submit, "Submit" %>
|
|
<% end %>
|