We build an entire Rails application from scratch, showing you every single step in the process. http://www.codeschool.com/code_tv/rails-app-from-scratch-part-1
$ rails new wandrr -d postgresql
$ cd wandrr
$ git init
$ git add .
$ git commit -m "new rails app"
gem 'twitter-bootstrap-rails'
$ bundle install
https://github.com/seyhunak/twitter-bootstrap-rails
$ rails g bootstrap:install
$ rails g bootstrap:layout application
$ git add .
$ git commit -m "adding twitter bootstrap"
$ rails g scaffold trip name:string description:text
$ rake db:create
$ rake db:migrate
$ rails server
$ git add .
$ git commit -m "adding twitter bootstrap"
root to: 'trips#index'
Don't forget to delete index.html in the public folder. Then restart server.
Head into trips/index.html.erb and add class="table" to the table tag
$ git add -u
$ git commit -m "Root to trips and fix table"
http://twitter.github.com/bootstrap/base-css.html#tables
$ rails g scaffold Destination name:string description:text
Add to models/trip.rb $ has_many :destinations
Add to models/destination.rb $ belongs_to :trip
Add trip_id to destination $ rails g migration add_trip_id_to_destinations trip_id:integer $ rake db:migrate
Add destination roote under trips in config/routes. resources :trips do resources :destinations end
<p>
<%= link_to 'New Destination', new_trip_destination_path(@trip) %>
</p>
@trip = Trip.find(params[:trip_id])
[@trip, @destination]
Change: @destination = Destination.new(params[:destination])
To: @trip = Trip.find(params[:trip_id]) @destination = trip.destinations.new(params[:destination])
Add: @trip = Trip.find(params[:trip_id])