-
Notifications
You must be signed in to change notification settings - Fork 17
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
Panda level submission #12
base: master
Are you sure you want to change the base?
Conversation
Nicely done! Everything works, looks great. 🎉 |
@jwo I updated this with tiger. I updated the Heroku site as well. |
@@ -16,3 +13,9 @@ | |||
@the_number = rand(number_as_string) | |||
erb :number | |||
end | |||
|
|||
get '/' do | |||
my_picks = YAML.load(File.read("./my_picks.yml")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!!!
Each time the page loads, it will need to pick up this file and interpret the yml file.
I'm going to push you a pick on this: Can you think of a way to have these picks be a Ruby class that dont' change?
…every time you visit the page
Hey @jperezish --- Check out these lines: https://github.com/jperezish/Episode8/blob/master/db/setup.rb#L10-L11 ActiveRecord::Base.connection.drop_database (connection_details.fetch('database')) rescue nil
ActiveRecord::Base.connection.create_database(connection_details.fetch('database')) rescue nil I bet you're having trouble dropping and creating the DB on heroku (because they don't allow those sorts of things). To try it out, we could remote the Assuming that's the case, what do you think your next move could be? (finally, this shows why rescue nil is evil) |
@jwo this is a tough one to sort out. I've been researching the whole topic around heroku and postgres and the best way to set to connect and seed a DB with Sinatra and Active Record. So I removed the
So now I'll sort through this bit. |
COOL, ok, so your data isn't there -- the pages don't exist. If you do Rails will typically through a 404 here, but you'll need to handle that yourself in Sinatra. |
Here's my Panda level. App deployed to Heroku as well.