Hi, I have a nice link which I intend to have non-idempotent consequences and so after a quick google I realized I want to use link_to with the :method => :post option. Only problem is that this stubbornly refuses to work for me. Using this option produces HTML like: <a href="/events/moderate?method=post"> clearly here this is not being interpreted correctly. I updated my rails today to 2.2.2. But I don''t know if I need to update my application also. I tried using the older :post => true method too, but it got turned into a GET Url also. Is my rails project somehow outdated? Thanks for any help you nay offer! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Mar-15 21:39 UTC
Re: Link_to with :method doesn''t work for me (newbie)
On Mar 15, 9:01 pm, Peter Laurens <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I have a nice link which I intend to have non-idempotent consequences > and so after a quick google I realized I want to use link_to with the > :method => :post option.Looks like you are doing link_to ''foo'', :some_routing_param => ''bar'', :method => :post If you do that then method => :post ends up in the hash of url parameters which isn''t what you want. You want it to be in the second hash of html options, which means you need to do link_to(''foo'', {:some_routing_params => ''bar'', ...}, :method => :post) Fred> > Only problem is that this stubbornly refuses to work for me. Using this > option produces HTML like: > > <a href="/events/moderate?method=post"> > > clearly here this is not being interpreted correctly. > > I updated my rails today to 2.2.2. But I don''t know if I need to update > my application also. I tried using the older :post => true method too, > but it got turned into a GET Url also. > > Is my rails project somehow outdated? > > Thanks for any help you nay offer! > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---