User and Place are the two nodes having has_many realtionship
@places = User.find(4).places
@places = @places.where(dog: false) if params[:no_dogs]
can I make these two into one so that if param comes then it involve where condition other wise ignore it
I don't believe that the
find()
method takes zero arguments. Maybe you're wanting this?Or if you wanted to work with the
User
model: