Reputation: 2363
I have a custom route called "work_path" and when I try to access it I get this error
"Missing template portfolios/show"
I am not trying to access the "show" view, but rather one named "work" (work.html.erb). I have no idea why it keeps trying to get me to the "show view"
My custom route
get 'portfolios/work' => 'portfolios#work', :as => :work
Portolios Controller
def work
@portfolio = @portfolio.active
end
The link I'm using:
<%= link_to "Work", work_path %>
I don't know why it's trying to redirect me.
Upvotes: 0
Views: 118
Reputation: 51151
You probably have also resources :portfolios
in routes.rb above your custom route and that causes your problem. Switch these lines' positions.
Upvotes: 2