On Mar 15, 9:01 pm, Peter Laurens <[email protected]>
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---