Guest User

Untitled

a guest
Jun 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. ### This does not work:
  2. ## _from.html.erb
  3. <% form_for @cvcat do |f| %>
  4. <%= f.error_messages %>
  5. <p>
  6. <%= f.label :category %><br />
  7. <%= f.text_field :category %>
  8. </p>
  9. <p>
  10. <% f.fields_for :vitaes do |entry_form| %>
  11. <%= render :partial => 'entry_form' %>
  12. <% end %>
  13. </p>
  14. <p><%= f.submit "Submit" %></p>
  15. <% end %>
  16. ## _entry_form.html.erb
  17. <div class="entry">
  18. <p>
  19. <%= entry_form.label :entry %>
  20. <%= entry_form.text_field :entry %>
  21. </p>
  22.  
  23. </div>
  24.  
  25. ###This works:
  26. ## _form.html.erb
  27. <% form_for @cvcat do |f| %>
  28. <%= f.error_messages %>
  29. <p>
  30. <%= f.label :category %><br />
  31. <%= f.text_field :category %>
  32. </p>
  33. <p>
  34. <% f.fields_for :vitaes do |entry_form| %>
  35. <div class="entry">
  36. <p>
  37. <%= entry_form.label :entry %>
  38. <%= entry_form.text_field :entry %>
  39. </p>
  40.  
  41. </div>
  42. <% end %>
  43. </p>
  44. <p><%= f.submit "Submit" %></p>
  45. <% end %>
Add Comment
Please, Sign In to add comment