Guest User

Untitled

a guest
Apr 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ## View
  2. <% form_for :photo, :url => { :action => "update_complete" } do |form| %>
  3. <% for photo in @photos %>
  4. <%= text_field_tag "photos[#{photo.id}][filename]", photo.filename %>
  5. <%= text_area_tag "photos[#{photo.id}][description]", photo.description %>
  6. <% end %>
  7. <% end %>
  8.  
  9. ## Controller
  10. def update_complete
  11. params[:photos].each do |id|
  12. @photo = Photo.find(id)
  13. @photo.update_attributes(params[:photos])
  14. end
  15. end
Add Comment
Please, Sign In to add comment