# Problem with link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/problem-with-link-to-remote/132736>\
**Category:** Rails\
**Created:** [March 24, 2008, 8:41am UTC](https://www.ruby-forum.com/t/problem-with-link-to-remote/132736 "2008-03-24T08:41:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [March 24, 2008, 8:41am UTC](https://www.ruby-forum.com/t/problem-with-link-to-remote/132736/1 "2008-03-24T08:41:20Z")

</div>

link\_to\_remote is passing :action as id and :id as action…

I have following in view…  
\<%= link\_to\_remote ‘Hello’, :update =\> ‘list’, :url =\> {:action =\>  
‘hello’, :id =\> project.id} %\>

and in log, I get this…  
Parameters:  
{“authenticity\_token”=\>“4fd2ba43462ed37b50793a388eb2dc6bc72aceb3”,  
“action”=\>“14”, “id”=\>“hello”, “controller”=\>“projects”}

ActionController::UnknownAction (No action responded to 14):

I dont know whats wrong… please help

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [March 24, 2008, 9:00am UTC](https://www.ruby-forum.com/t/problem-with-link-to-remote/132736/2 "2008-03-24T09:00:21Z")

</div>

please check your mapping rules in file config/routes.rb and post  
your html source code of your page

On Mar 24, 3:41 pm, “Vapor …” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [March 24, 2008, 9:43am UTC](https://www.ruby-forum.com/t/problem-with-link-to-remote/132736/3 "2008-03-24T09:43:06Z")

</div>

tristan wrote:

> please check your mapping rules in file config/routes.rb and post  
> your html source code of your page

nothing special actually…

map.resources :projects, :has\_many =\> :bugs, :member =\> {:hello =\> :get}

# Install the default routes as the lowest priority.

map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [March 24, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/problem-with-link-to-remote/132736/4 "2008-03-24T16:52:31Z")

</div>

I seem to have figured out the problem…  
it doesn’t work in a loop a guess.

\<% for post in @posts %\>

 \<%=h post.body %\> \<%= link\_to\_remote 'Show', :url =\> post, :update =\> 'div2' %\> \<%= link\_to 'Edit', edit\_post\_path(post) %\> \<%= link\_to 'Destroy', post, :confirm =\> 'Are you sure?', :method =\> :delete %\> \<% end %\>

it won’t work up there but it would work fine with ‘New’ link…

\<%= link\_to\_remote ‘New post’, :url =\> new\_post\_path, :update =\> ‘div2’  
%\>

please helppp!!
