Advertisement
Guest User

Untitled

a guest
May 6th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. = simple_form_for(@book) do |f|
  2. = f.error_notification
  3. = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present?
  4. .form-inputs
  5. = f.input :title, as: :string, label: 'Book Title'
  6. = f.input :release_year, as: :string, label: 'Release Year'
  7. %br
  8. = f.simple_fields_for :book_authors do |f2|
  9. = render 'book_author_fields', f: f2
  10. .links
  11. = link_to_add_association 'Add Author', f, :book_authors
  12. .form-actions
  13. = f.button :submit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement