Problem with link_to_remote

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

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 …” [email protected]

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’

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!!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs