6.3 - Find a destination - Associations I

My code

class DestinationsController < ApplicationController

def show
@destination = @destinations.find(params[:id])
end

end

error ocure: undefined method `find’ for nil:NilClass

doesn’t seem to exist. What about,

Destination.find(...)

The class is defined in the models folder.

Show a destination

2 Likes

Thanks! I thought it takes variable from destinations_controller:
@destinations = @tag.destinations

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.