Forum: Ruby on Rails link_to_remote() - can I post data with it???

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
16319aba44da117ca73484d1ce32227b?d=identicon&s=25 Szczepan Faber (szczepiq)
on 2006-01-17 21:59
(Received via mailing list)
can I post data with link_to_remote(),

link_to() has special option :post => true and viola

Thanks in advance
9b7647d55df4584d7031130915556040?d=identicon&s=25 Will Briggs (Guest)
on 2006-01-17 22:32
(Received via mailing list)
You can serialize form elements by adding the :with => "Form.serialize(
'form_id' )" attribute to your link_to_remote tag.  I'm sure there's a
way
of serializing additional data, but I'm not sure what it is.  You can
specify additional attributes in the :url => { :action => <blah> }
section,
but I'm a total newb and am not sure if those are sent via GET or POST
(I am
guessing they are sent via GET since they are associated with the URL
attribute).

-Will
5b9fe87ec1faa67a4599782930f45ec9?d=identicon&s=25 Sam Stephenson (Guest)
on 2006-01-17 22:38
(Received via mailing list)
Hi,

On 1/17/06, Szczepan Faber <szczepiq@gmail.com> wrote:
> can I post data with link_to_remote(),
>
> link_to() has special option :post => true and viola

link_to_remote makes a POST request by default.  If you want a GET
request, just specify :method => :get.

--
sam
This topic is locked and can not be replied to.