Skip to content

Instantly share code, notes, and snippets.

@Sanix-Darker
Created October 19, 2017 07:40
Show Gist options
  • Save Sanix-Darker/a804ac2ddeb786d3aee08a1045775df4 to your computer and use it in GitHub Desktop.
Save Sanix-Darker/a804ac2ddeb786d3aee08a1045775df4 to your computer and use it in GitHub Desktop.
[SHELL] Helpfull rails commands
#basics:
rails console
rails server
rake
rails generate
rails dbconsole
rails new app_name
#create scaffold
rails generate scaffold level
#destroy scaffold
rails destroy scaffold level
#add collum
rails generate migration AddListIdColumnToIdeas list_id:integer
#add migrations
rake db:migrate
#revoke migration
rake db:revoke
rake db:rollback
#To have the rails console:
rails console
>> User.destroy(1)
>> User.find(1)
ActiveRecord::RecordNotFound: Could not find User with id=1
>> exit
... And so on, Awesome tuto here: http://blog.teamtreehouse.com/introduction-rails-command
@SANGED
Copy link

SANGED commented Oct 19, 2017

Nice nice!!

@Sanix-Darker
Copy link
Author

That can save your time!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment