6.3 - Find a destination - Associations I


#1

My code

class DestinationsController < ApplicationController

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

end

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


#2

doesn’t seem to exist. What about,

Destination.find(...)

The class is defined in the models folder.

Show a destination


#3

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


#4

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