Bob wrote:> How can I get a name/id for a form using the remote form tag?
> <%= form_remote_tag :url => { :action => :add_to_cart, :id =>
timecard }
> %>
>
> gives me:
> <form action="/timecard/add_to_cart/4"
> method="post"
> onsubmit="new
Ajax.Request(''/timecard/add_to_cart/4'',
> {asynchronous:true, evalScripts:true,
> parameters:Form.serialize(this)});
> return false;">
>
> But there is no form ID in there. I''ve tried putting ":id
=> timecard"
> before and after the :url assignment, but it never actually shows up.
>
> In the mean time I''ve gotten rid of those tags and just created
the form
> myself. Anyone know what the ''ruby way'' to do this?
I''m new at this, but I think you can do something like:
form_remote_tag :html => { :name => ''form_name'', :id
=> ''form_id'' },
:url => { :action => :add_to_cart, :id => timecard }
--
Posted via http://www.ruby-forum.com/.