Last active
July 17, 2018 10:10
-
-
Save maslick/037452d101340fb069f0fee3c439d9f1 to your computer and use it in GitHub Desktop.
railz cheet sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create new app | |
rails new haha-app | |
// create db | |
rake db:create | |
// create chapter | |
rails g scaffold Chapter title:string content:text | |
// migrate changes | |
rake db:migrate | |
// make chapter default route (config/routes.db) | |
root 'chapters#index' | |
// add paperclip | |
gem "paperclip", "~> 6.0.0" | |
bundle install | |
// add photos | |
rails g scaffold Photo title:string chapter:references | |
rake db:migrate | |
// add attachment to photo | |
rails g paperclip photo image | |
rake db:migrate | |
// add simple_form | |
gem 'simple_form' | |
rails generate simple_form:install | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment