Review
Complete Exit Ticket: http://ix-exit-tickets.herokuapp.com/
Exercise: Fill in the blanks app
- Clone (
git clone
) this app to your ixperience
folder.
cd
into fill_in_the_blanks
and run bundle
- Oh no! One of your gems has gone rogue! Find it and remove it. While you're there, add the
pry-rails
gem to your app. Which group block does this gem go inside?
- Run
bundle
again
- Run
rails server
- Navigate to
localhost:3000
in your browser. What does the error indicate?
- Run the proper command to resolve the error.
- Run
rails server
again, is localhost:3000
working? Read the new error then continue on to step 9...
- There's a controller already made for you (not application_controller), navigate to that controller and inspect the name, what's wrong with it? (Think convention) Find the problem and correct it.
- Navigate to your routes and fix the code there to resolve the error from your browser (Hint: It has to do with your
root
).
- Your controller has all of your CRUD actions and a private method for whitelisting, but they're empty. We'll fill them out as we move through the following steps, use the comments inside of the actions as guidelines.
- Create corresponding views for each of your actions.
- Which actions do we not create views for? Why?
- Navigate to
localhost:3000/posts/new
in your browser
- Oh no, we get an error! What does the error indicate? How can we fix it?
- Create routes for your posts. Does the error go away?
- We have some seeded data already in the app, where is it located? What command do we run to seed the data?
- Run the seed command in your terminal.
- Now we have some seed data, how can we get that data to display on our index view?
- Fill in the code to have our posts display properly.
- We want to add some more posts, edit your
new
view and the corresponding _form
partial to allow creation of new posts via a form.
- What other files do we need to fill in before the new form will work properly? Be sure to add validations to the Post model.
- Go back to your posts_controller and fill in the corresponding actions to allow creation and viewing of a Post.
- Now we want to go back and edit one of our existing posts. Fill in the corresponding view and actions to make this work.
- Almost done! Add a button next to each Post that allows us to destroy that post.
BONUS:
- Edit your layout to have a custom, site wide, title (i.e., "Ian's Rails App!")
- Add links for easy navigation between pages
Your app should:
- Be error free
- Have your index page display all of your posts
- Including the seeded data that came with the app
- Allow you to Create, Read, Update, and Destroy posts
- Have your root set to your posts index
Push this app to a new public repo in your GitHub called fill_in_the_blanks
then submit the link via Piazza
Don't remember how to make a new GitHub repo? Click here for instructions
Note: Since the app you cloned already has a remote repo, you will have to reset your remote url by using the following command in the terminal while inside of your fill_in_the_blanks directory: git remote set-url origin <paste new url here>
Great work! Now add and commit your work then push it to GitHub :)