I am using devise for my user model and in the routes.rb I have devise_for :users
How would I go about giving users posts?
Would it just be in the routes:
resources :users do
resources :posts
end
Or do you have to do something special due to devise
Those routes will work, additionally you need to set up your relationships in your models, assuming your posts table includes user_id as a foreign key:
edit
To add the foreign key to your Post model:
This will create a migration file in the db/migrate folder that looks like:
You can then migrate these changes to your database using:
rake db:migrate