My code
class DestinationsController < ApplicationController
def show
@destination = @destinations.find(params[:id])
end
end
error ocure: undefined method `find’ for nil:NilClass
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.
Thanks! I thought it takes variable from destinations_controller:
@destinations = @tag.destinations
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.