Ruby On Rails Paths

Posted by dweebsonduty on Stack Overflow See other posts from Stack Overflow or by dweebsonduty
Published on 2010-03-25T04:51:23Z Indexed on 2010/03/25 5:03 UTC
Read the original article Hit count: 440

Filed under:
|
|

I am having trouble with paths in ruby on rails

My Routes:

    map.resources :companies do |company|
  company.resources :customers do |customer|
   customer.resources :jobs 
  end
  end

Currently I am creating the paths by hand:

<td><%= link_to 'Show', "/companies/#{params[:company_id]}/users/#{user.id}" %></td>
<td><%= link_to 'Edit', "/companies/#{params[:company_id]}/users/#{user.id}/edit" %></td>

For some reason I cant figure out how to get new_company_user to work I keep getting errors.

The routes are all there I just need help with dynamically creating them by using the API

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routes