adding and displaying peeps#213
Conversation
siellsiell
left a comment
There was a problem hiding this comment.
Hey, it's Simo, a coach. I've reviewed your code and left a few comments below. Do ask if you have any questions.
| get '/peeps' do | ||
| @peeps_return = Peep.all | ||
| erb :peeps | ||
| end | ||
|
|
||
| get '/peeps/post' do | ||
| erb :post | ||
| end | ||
|
|
||
| post '/peeps/new' do | ||
| Peep.post(params[:message]) | ||
| redirect '/peeps' | ||
| end |
There was a problem hiding this comment.
Your routs are quite close to the standard RESTful routing conventions, but not quite! If you'd like to use more standard names for you routes, check out this blog post on RESTful routing: https://medium.com/@shubhangirajagrawal/the-7-restful-routes-a8e84201f206
| get '/test' do | ||
| 'Test page' | ||
| end |
There was a problem hiding this comment.
It's always a good idea to remove test code from code you submit for code review (anywhere, not just at Makers)
| if ENV['ENVIRONMENT'] == 'test' | ||
| connection = PG.connect(dbname: 'chitter_test') | ||
| else | ||
| connection = PG.connect(dbname: 'chitter') | ||
| end |
There was a problem hiding this comment.
This piece of code appears twice in this file. How might you remove this duplication?
| end | ||
| def test_data_script | ||
|
|
||
| p "setting up test chitter" |
There was a problem hiding this comment.
Same here, remove test code.
| require 'pg' | ||
| require 'peep' | ||
|
|
||
| feature 'viewing peeps' do |
Your name
Please write your full name here to make it easier to find your pull request.
User stories
Please list which user stories you've implemented (delete the ones that don't apply).
README checklist
Does your README contains instructions for
Here is a pill that can help you write a great README!