Reputation: 13
I have a method in controller as def match
which is in JobsController
.
def match
end
I have created match.html.erb in /views/jobs/match.html.erb, I want this code output to come as it is a static page. I have given a link in index page to render this match.html.erb file like this:
<td><%= link_to 'Match', jobs_match_path %></td>
I have defined match path in route file like this:
get 'jobs/match', :to => redirect('jobs/match.html')
But I am getting an error as:
ActiveRecord::RecordNotFound in JobsController#show Couldn't find Job with 'id'=match
Upvotes: 0
Views: 64
Reputation: 30071
As the others said. But I'd do this way
resources :jobs do
get 'match', to: 'jobs#match', on: :collection
end
So your routes definitions are order-independent
Upvotes: 1