Topics Covered: User Authorizations
Adding users and posts to our website in the terminal, or individually from our website, can be pretty laborious. A much better way to pre-populate the data that we want to exist in production for our site is to use the seeds.rb
file. Add some users and posts to Meowbook in the db/seeds.rb
file of Meowbook. To add the new data, simply run with rake db:seed
.
If we had built this application for dogs, we might have been able to trust them with the ability to edit each post. With cats, it's not okay to be so trusting. Make it so that only cats with the role "admin" can edit posts!
When you're thinking about starting your projects, there are some practices that are going to save you a lot of grief. Follow the steps below as Zack and Isra start their final project.
rails new meowbook
to create a new rails app on her machine.git clone URL
where URL is the clone URL.push
and pull
to their hearts' content.
Now that you have Git and GitHub set up, use them to your advantage. After completing each feature of your application, add
and commit
your code with a meaningful message. When you have a couple of features that are functioning, push
your code to GitHub! Most importantly, remember to pull
your partner's code before you start working to avoid merge conflicts!
In order to help you stay on track and meet your goals, TA's will be checking in with you every single day. So it is important that you talk about your progress to a TA at the end of the day.
By now, you should be thinking about starting your MVP for your Rails application. This also includes neat implementation of Devise if your application is using authentication.
Micah and the TA's are around to help you as code along, and it's a great idea to have us look at your resources and migrations before you run them for the first time!