undefined local variable or method `training_path' for #<#<Class:0xa856f9c>:0xa857244>----
views/trainer/home.html.erb<li>
<%= link_to "Training", training_path %>
</li>
routes.rbresources :trainer do
match "/course", to: 'trainer#course', :as => :training
end
controller/trainer_controller.rbclass TrainerController < ApplicationController
def course
end
endviews/trainer/course.html.erb<h1> Learning Ruby </h1>rake routes shows me following line related to the route:
trainer_training /trainer/:trainer_id/course(.:format) trainer#course
Thanks.
I have fixed this issue. The 'match' statement needs to be outside the resource block in routes.rb. Rest everything remains the same.
Thanks.
Sent from Galaxy R, please ignore typo or brevity
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/10f2ce62-4b20-4d29-a89d-56391a0f3b38%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.