Skip to content

Instantly share code, notes, and snippets.

@alksl
Created May 12, 2014 19:52
Show Gist options
  • Save alksl/5e7504c8b2de84aaf8b1 to your computer and use it in GitHub Desktop.
Save alksl/5e7504c8b2de84aaf8b1 to your computer and use it in GitHub Desktop.
$ rails new vinylcollections
show
$ rails g controller welcome index
routes.rb: root "welcome#index"
Gemfile: gem 'bootstrap-sass', '~> 3.1.1'
$ bundle update
application.css: *= require bootstrap
$ cp ~/prep/welcome/index.html.erb app/views/welcome/index.html.erb
$ cp ~/prep/superhero.css vendor/assets/stylesheets/superhero.css
application.css: *= require superhero
show
$ rails g model Collection name:string
$ rails g model Issue artist:string title:string cover_url:string
$ rails g moder CollectionItem collection:references issue:references
collection.rb: has_many :collection_items
collection.rb: has_many :issues, through: :collection_items
collection_item.rb: belongs_to :issue
collection_item.rb: belongs_to :collection
$ rake seed_db_data
routes.rb: resources :collections
$ rake routes
$ rails g controller collections
cp ~/prep/collections/new.html.erb app/views/collections/new.html.erb
make the actions
cp ~/prep/collections/index.html.erb app/views/collections/index.html.erb
make the actions
routes.rb: recources :items (nested)
$ rake routes
$ rails g controller items
cp ~/prep/items/new.html.erb app/views/items/new.html.erb
make the actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment