I have home.html.erb file which has a link for *course.html.erb *file
using link_to. I have defined a named route for this navigation. On
clicking the link, I get an error as shown below. Looks like the named
route is not accessible in the view.
Is my routes.rb entry correct? I am not sure if after match in
file, the name of view should be in single quotes or double quotes and
whether a “/” is needed before view name. I tried both, it didn’t work.
undefined local variable or method `training_path’ for
resources :trainer do
match “/course”, to: ‘trainer#course’, :as => :training
class TrainerController < ApplicationController