To drop the database:
heroku pg:reset DATABASE
To recreate the database:
heroku run rake db:migrate
To populate the database with seed data:
| # username = "my_username" | |
| # pwd = "my_password" | |
| # target_path = "my_target_path" | |
| # saving auth cookie | |
| system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \ | |
| https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027} | |
| (25..600).each do |i| | 
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') | 
To drop the database:
heroku pg:reset DATABASE
To recreate the database:
heroku run rake db:migrate
To populate the database with seed data:
| How to reset postgres' primary key sequence when it falls out of sync? | |
| heroku pg:psql | |
| -- Login to psql and run the following | |
| -- What is the result? | |
| SELECT MAX(id) FROM your_table; | |
| -- Then run... | |
| -- This should be higher than the last result. | 
I hereby claim:
To claim this, I am signing this object:
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') | 
| upstream myapp_puma { | |
| server unix:/tmp/myapp_puma.sock fail_timeout=0; | |
| } | |
| # for redirecting to https version of the site | |
| server { | |
| listen 80; | |
| rewrite ^(.*) https://$host$1 permanent; | |
| } | |
| /*! | |
| * froala_editor v2.7.1 (https://www.froala.com/wysiwyg-editor) | |
| * License https://froala.com/wysiwyg-editor/terms/ | |
| * Copyright 2014-2017 Froala Labs | |
| */ | |
| (function (factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| // AMD. Register as an anonymous module. | |
| define(['jquery'], factory); | 
gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundleRAILS_ENV=production rake db:create db:migrate db:seedrake secret and copy the outputexport SECRET_KEY_BASE=output-of-rake-secretrake assets:precompile. This will create a folder public/assets that contains all of your assets.RAILS_ENV=production rails s and you should see your app.Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.