I’m stuck with this simple named route problem. I have:
#Controller:
def show
@thing = Thing.find(params[:id])
end
#Routes.rb:
match '/:name' => 'things#show'
The response I get is Couldn't find Thing without an ID. If I change the controller to:
@thing = Thing.find(params[:name])
Then I get Couldn't find Thing with ID=thing. What am I missing?
1 Answer