how to pass params to button_to_remote ?

Hi folks,

I have a form that I populate, and then submit with button_to_remote, but I would like to have all my fileds that I populated passed as parameters (like the params hash) with to my controller. How would you do that ?

Reagrds

Mamadou Touré wrote:

Hi folks,

I have a form that I populate, and then submit with button_to_remote, but I would like to have all my fileds that I populated passed as parameters (like the params hash) with to my controller. How would you do that ?

Reagrds

Hi,

button_to_remote is having following syntax:

<%= button_to_remote "<button name>", :url => {:controller => "<controller_name>", :action => "<action_name>", :id => <id>, :paramterers => "<parameters_value>"}, :html => {:style => "", :class => ""} %>

If you are trying to submit a form using ajax call, you can try for form_remote_tag

Might Help,

Saurabh.