0

I have a registrations controller which of course conflicts with Devise's registrations controller and instead of renaming I thought of namespacing my registrations controller to :

namespace :team do
resources :registrations
end

which works fine, but I cannot nest inside this Team::Registrations I have been using

namespace :team do
resources :registrations do
  resources :players
 end
 end

The route helper I want is new_team_registration_player_path or team/registration/:id/players/new

but instead I get /team/registration/player/new(.:format) without the team/registrations/:id.

Any ideas ?

1
  • Given the above routes definition, this is a valid route (as generated by nested resources). If you want all routes of "players" under some ID of registration, then you should defined routes like resources :registrations, :only => [:show] do; resources :players; end. In this way, all "players" routes will be made like this /team/registration/:id/<players routes>/. Let me know if it solves your problem. Commented Feb 24, 2015 at 11:54

1 Answer 1

1

Are you providing the @registration or the registration's id parameter to the path helper?

new_team_registration_player_path(1) # => team/registration/1/players/new
Sign up to request clarification or add additional context in comments.

1 Comment

Hi I m providing the @registration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.