you can use :method => :post as a aprameter for the options hash. This will create some javascript which will make the link submit by POST rather then GET. That way, the parameters won't show up in the URL. but of course the "hidden" parameters will still be in the pages' source code.
it's
:method => :post
not
:method => post
and it doesn'T belong in the URL hash, but in the options hash ...
link_to "Edit", { :action=>"user", :id => user.id }, {:method => :post }
Hi,
link_to "Edit", { :action=>"user", :id => user.id }, {:method => :post } I used this command. but still id is displying. for me, id shouldn't display in the browser. it should be a hidden field.
Everything is fine now with your link_to. The only problem here is that "id" is a somehow special field in rails, as are also controller and action. Those parameters are automagically matched according to the rules defined in the routes.rb file, so if you are using id, link_to is going to use the route defined by " map.connect ':controller/:action/:id'".
If you don't like that, you have one of two options: either change the route in routes.rb or use a different parameter than id, and then in your controller read that from the params object.
Regards,
javier ramirez
ok, i'm confused, what are you expecting this method to do for you? you say "id is displying for me, id shouldn't display in the browser. it should be a hidden field."
so which is it? a link or a hidden form field?
Chris