Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## routes.rb
- resources :users do
- resources :tweets
- end
- resources :tweets
- ## tweets_controller.rb
- def index
- if params[:user_id]
- @tweets =Tweet.find_by_user_id(params[:user_id])
- else
- @tweets = Tweet.all
- end
- end
Add Comment
Please, Sign In to add comment