Answer the question
In order to leave comments, you need to log in
Why can't find the user?
Hello. Following the instruction of the video lesson on codeschool ran into a problem. The situation is this:
There are users and there are articles. The models specify relationships, User has_many article and Articles belongs_to user. In routes we specify:
resources :users do
resources :articles
end
def get_user
@user = User.find(params[:id])
end
Answer the question
In order to leave comments, you need to log in
try
resources :users do
member do
resources :articles
end
end
resources :users do
resources :articles
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question