Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## View
- <% form_for :photo, :url => { :action => "update_complete" } do |form| %>
- <% for photo in @photos %>
- <%= text_field_tag "photos[#{photo.id}][filename]", photo.filename %>
- <%= text_area_tag "photos[#{photo.id}][description]", photo.description %>
- <% end %>
- <% end %>
- ## Controller
- def update_complete
- params[:photos].each do |id|
- @photo = Photo.find(id)
- @photo.update_attributes(params[:photos])
- end
- end
Add Comment
Please, Sign In to add comment