Rails Flashcards
Where are links managed in rails?
routes.rb
Where is the Rails API found?
api.rubyonrails.org
How do you get started with rails?
gem install rails;rails new myapp;cd myapp;rails server
Template files where ruby and html code co-exist?
.erb files
How do you display an image link?
0), :action => ‘about’ %>
Where are gems needed for a web application listed?
Gemfile
How do you install all gems listed in Gemfile?
bundle install
How do you start the server? What port will it listen on by default?
rails server; runs on port 3000 by default
How do you get started with (install) heroku?
gem install heroku
How do you upload your SSH pulic key to heroku?
heroku keys:add
How do you setup your heroku remote applicatino?
heroku create
How do you push your master branch to heroku remote?
git push heroku master
How do you renamge your heroku app
giving it a new [name].heroku.com?,heroku rename superName
What does ReST stand for?
Representational State Transfer
How do you get rails to automatically generate User with id, name, email?
rails generate scaffold User name:string email:string
How do you create a class “Task” that extends from ActiveRecord?
class Task < ActiveRecord::Base
How do you get all the names as an array?
find(:all).collect(&:name)
How do you prevent an attribute (admin) from being set via mass assignment?
attr_protected :admin
app/
Core application (app) code, including models, views, controllers, and helpers
app/assets
Applications assets such as cascading style sheets (CSS), JavaScript files, and images
bin/
Binary executable files
config/
Application configuration
db/
Database files
doc/
Documentation for the application
lib/
Library modules
lib/assets
Library assets such as cascading style sheets (CSS), JavaScript files, and images
log/
Application log files