Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first try #224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AbdirizakIdris
Copy link

@AbdirizakIdris AbdirizakIdris commented Apr 4, 2022

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).

  • User story 1: "I want to see all the messages (peeps) in a browser"
  • User story 2: "I want to post a message (peep) to chitter"
  • User story 3: "I want to see the date the message was posted"
  • User story 4: "I want to see a list of peeps in reverse chronological order"
  • User story 5: "I want to filter on a specific keyword"

README checklist

Does your README contains instructions for

  • how to install,
  • how to run,
  • and how to test your code?

Here is a pill that can help you write a great README!

@@ -17,3 +17,5 @@ end
group :development, :test do
gem 'rubocop', '1.20'
end

gem "reloader", "~> 0.1.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? Did you mean sinatra?

@@ -88,6 +134,7 @@ PLATFORMS
DEPENDENCIES
capybara
pg
reloader

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sinatra?

end

post'/peeps' do
# erb :'newpeep'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note required?

connection = PG.connect(dbname: 'chitter')
result = connection.exec("SELECT * FROM peeps;")
result.map { |peeps| peeps['message'] }
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep indentation consistent

@@ -1,9 +1,26 @@
require 'sinatra/base'
require './lib/messages'

class Chitter < Sinatra::Base
get '/test' do
'Test page'
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice restful routes

@EdwardAndress
Copy link

This is a good clear solution with good naming and it clearly demonstrates the main learning objectives around reading from and writing to a DB. The next step would be to show the date on which a Peep was created. If you had more time, would you know how to get started?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants