# Button\_to Problem

**URL:** <https://www.ruby-forum.com/t/button-to-problem/159319>\
**Category:** Rails\
**Created:** [February 3, 2009, 12:51pm UTC](https://www.ruby-forum.com/t/button-to-problem/159319 "2009-02-03T12:51:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gte351s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@gte351s](https://www.ruby-forum.com/u/gte351s)\
**Post date:** [February 3, 2009, 12:51pm UTC](https://www.ruby-forum.com/t/button-to-problem/159319/1 "2009-02-03T12:51:57Z")

</div>

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?..

---

<div class="post-metadata">

**Author:** ![gte351s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@gte351s](https://www.ruby-forum.com/u/gte351s)\
**Post date:** [February 3, 2009, 6:07pm UTC](https://www.ruby-forum.com/t/button-to-problem/159319/2 "2009-02-03T18:07:26Z")

</div>

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
