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.
Szczepan F. (Guest)
on 2006-01-17 22: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
Will B. (Guest)
on 2006-01-17 23: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
Sam S. (Guest)
on 2006-01-17 23:38
(Received via mailing list)
Hi,

On 1/17/06, Szczepan F. <removed_email_address@domain.invalid> 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.