From: Rodrigo Lueneberg Date: 2013-07-05T08:38:57+09:00 Subject: URL "id" element not part of the params objects after submitting a form via form_tag Why is the URL "id" element not part of the params objects after submitting a form via form_tag? Steps: 1. Go to URL http://localhost:3000/users/delete?id=45 2. Press Submit button 3. Read id param in order to delete user, then redirect form

Delete Confirmation

<%= form_tag('/users/delete') do %> <%= submit_tag 'Clique aqui para confirmar exclusão' %> <% end %> def delete if request.post? if (!params[:id].nil?) @user=User.find(params[:id]) @user.delete end redirect_to(:controller=>'users', :action => 'list') end end When the form is posted, params[:id] does not exist, why? Thanks -- Posted via http://www.ruby-forum.com/.