Button_to Problem


#1

I’m having a similar problem with button_to and button_to_remote - I’m
trying to set the action to submit through:

<%= button_to ‘update’, { :action => “update”, :id => product.id } %>

Regardless, the button’s action points to /products/:id as the html
shows:

Why?..


#2

Hi Shilo,

On Tue, 2009-02-03 at 12:51 +0100, Shilo A. wrote:

<input type="hidden"

value=“d8188afe727a223642b0d51579c9a2333f1e5ba5”
name=“authenticity_token”/>

Why?..

That’s a RESTful url. A POST to a resource with an ID is the RESTful
equivalent of an Update in CRUD. Google ‘rails restful routes’ for
more.

HTH,
Bill