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

<p>Delete Confirmation</p>

<%= 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/.

You did not provide any context, which makes helping difficult.
I _assume_ you are talking about Rails, since `form_tag` is not
part of Ruby, but there exists a `form_tag` helper in Rails.

Maybe you better post your question in a Rails mailing list.

Regards,
Marcus

···

Am 05.07.2013 01:38, schrieb Rodrigo Lueneberg:

Why is the URL "id" element not part of the params objects after
submitting a form via form_tag?

--
<https://github.com/stomar/&gt;

Thanks. I will move it to rails list.

···

--
Posted via http://www.ruby-forum.com/.