# Button\_to\_remote problem "index 115225 out of string"

**URL:** <https://www.ruby-forum.com/t/button-to-remote-problem-index-115225-out-of-string/172515>\
**Category:** Rails\
**Created:** [July 22, 2009, 6:47pm UTC](https://www.ruby-forum.com/t/button-to-remote-problem-index-115225-out-of-string/172515 "2009-07-22T18:47:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 22, 2009, 6:47pm UTC](https://www.ruby-forum.com/t/button-to-remote-problem-index-115225-out-of-string/172515/1 "2009-07-22T18:47:03Z")

</div>

hey all

I have some nested resource ‘sku\_price\_bands’ which are nested inside  
‘skus’ which are nested inside ‘music\_services’:

in routes.rb:

map.resources :music\_service do |music\_service|  
music\_service.resources :skus do |sku|  
sku.resources :sku\_price\_bands  
end  
end

Now, i’m trying to use some button\_to\_remote form helpers and getting an  
error like

“index 115225 out of string”

Here’s an example of an exploding helper:

\<%= button\_to\_remote “Delete this sku”,  
music\_service\_sku\_path(@music\_service, sku), :method =\> :delete %\>

I have a skus\_controller (the usual restful controller), with an update  
action which expects to get :music\_service\_id, and i have the  
appropriate route set up, i can see it in rake routes:

music\_service\_sku GET /music\_service/:music\_service\_id/skus/:id  
{:action=\>“show”, :controller=\>“skus”}  
PUT /music\_service/:music\_service\_id/skus/:id  
{:action=\>“update”, :controller=\>“skus”}  
DELETE /music\_service/:music\_service\_id/skus/:id  
{:action=\>“destroy”, :controller=\>“skus”}

There’s nothing funny going on with @music\_service and sku - they are  
both defined and point to some appropriate instances - i can see this by  
inspecting them on the page and logging the results. They all have the  
default to\_param method from AR:Base.

It’s always the same ‘11525’ number that shows up in the exception.

I’m out of ideas - can anyone help?  
max

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 22, 2009, 6:54pm UTC](https://www.ruby-forum.com/t/button-to-remote-problem-index-115225-out-of-string/172515/2 "2009-07-22T18:54:57Z")

</div>

Max W. wrote:

> \<%= button\_to\_remote “Delete this sku”,  
> music\_service\_sku\_path(@music\_service, sku), :method =\> :delete %\>

Never mind - the problem was that i had to pass the path as the :url  
option, ie

\<%= button\_to\_remote “Delete this sku”,  
:url =\> music\_service\_sku\_path(@music\_service, sku),  
:method =\> :delete %\>

doh. I get mixed up with this stuff because with link\_to you just pass  
the path (like in my original example) but in link\_to\_remote you have to  
put it in the :url option.

Anyway, thanks for reading 🙂
