here is my route
resources :games do
resources :message_templates, :shallow => true
my rake routes is like this
game_message_templates GET /games/:game_id/message_templates(.:format) message_templates#index
POST /games/:game_id/message_templates(.:format) message_templates#create
new_game_message_template GET /games/:game_id/message_templates/new(.:format) message_templates#new
edit_message_template GET /message_templates/:id/edit(.:format) message_templates#edit
message_template GET /message_templates/:id(.:format) message_templates#show
PUT /message_templates/:id(.:format) message_templates#update
DELETE /message_templates/:id(.:format) message_templates#destroy
and my _form.erb, looks like this
<% form_for(@message_template) do |f| %>
but I get this error
undefined method `message_templates_path'
It looks like you’re creating a new message template for a given game in which case you need to provide the route with the associated game. If it were an existing message template the path would be message_template_path rather than message_templates_path.
Say: