Skip to content

Instantly share code, notes, and snippets.

@AlexNisnevich
Last active January 4, 2016 13:08
Show Gist options
  • Save AlexNisnevich/8625556 to your computer and use it in GitHub Desktop.
Save AlexNisnevich/8625556 to your computer and use it in GitHub Desktop.
RailsBridge tips [ http://git.io/WCKhtA ]
Thanks for coming to RailsBridge!!
If you have any questions at any time, feel free to email us at
alex [dot] nisnevich [at] gmail [dot] com
markmillan [at] gmail.com
lindseysugino [at] gmail.om
Resources
=========
Rails:
- http://ruby.railstutorial.org/ruby-on-rails-tutorial-book [also available as a book]
- http://railsforzombies.org/
- http://guides.rubyonrails.org/
- http://railscasts.com/
HTML, CSS, and JavaScript:
- http://docs.railsbridge.org/frontend/
Ruby, JavaScript, and Python:
- www.codecademy.com
git:
- http://try.github.io/
- http://pcottle.github.io/learnGitBranching/
And of course:
- www.stackoverflow.com
Bootcamps and events:
- http://bootcamps.in/
- http://www.meetup.com/sfruby/
Useful commands
===============
cd <directory> - move to directory
ls - list contents of directory
mkdir <directory> - create new directory
To create new rails application:
rails new <applicationName>
To run rails server:
rails server
(Ctrl-C to exit)
And go to localhost:3000 in your browser.
To run rails console:
rails console
(Ctrl-C to exit, or Ctrl-D if Ctrl-C doesn't work)
To initialize git and heroku:
git init
heroku create
To generate rails scaffolds:
rails generate scaffold <table> <field>:<type> <field>:<type> (etc.)
For example,
rails generate scaffold topic title:string description:text
Then to update the database, run:
rake db:migrate
To update heroku site:
git add .
git commit -m "<message>"
git push heroku master
And if you updated the database, also run:
heroku exec rake db:migrate
To open heroku site:
heroku open
Useful paths
============
app/assets/ <--- CSS and javascript goes here (images should technically go here too, but heroku is weird about it)
app/controllers/ <--- controllers go here
app/models/ <--- models go here
app/views/ <--- views go here (different folder for each controller)
config/routes.rb <--- this file determines which URLs go to which controllers and actions
Gemfile <--- your application's gems (libraries) go here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment