Ruby on Rails Tuesday, August 2, 2011

Hi,

I am making a survey app.

The user takes the survey and I'm saving it fine.

But what i want next is to redirect the user to /surveys/1/results
after completion.

I have tried the following in my routes file:


Rails.application.routes.draw do
resources :surveys do
match 'results' => 'results#index'
end
resources :survey_answers
end

And in my controller i tried:
redirect_to survey_results_path(@survey)

but im getting:
No route matches {:controller=>"results"}

Any help?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment