Want to see the full-length video right now for free?
You will code along with Sean as he builds the application. Do what he does, pause the video if you need to catch up or explore something further. Hop into the chat room to ask questions as you have them, or send emails to learn@thoughtbot.com. We find that the act of doing is a very effective way of learning.
You should have access to a GitHub repo for the workshop. This repository is where you'll do your work for the app you'll build with Sean. Fork this private repo into your own Github Account. If you don't know how to do this, there are instructions on GitHub
By working in your own fork of this repository we'll be able to see the code you're writing, answer questions, and even comment on it.
See the README on GitHub for more information.
rails new scratch_pad
cd scratch_pad
turbolinks
gem from the Gemfile"data-turbolinks-track" => true
from stylesheet and javascript tags in
app/views/layouts/application.html.erbgem 'backbone-on-rails', '~> 1.1.0.0'
to the Gemfilegem 'lodash-rails', '~> 2.2.1'
to the Gemfilebundle install
rails generate backbone:install
For simplicity add window.App = window.ScratchPad
to
app/assets/javascripts/scratch_pad.js.coffee
window.ScratchPad =
Models: {}
Collections: {}
Views: {}
Routers: {}
initialize: ->
alert('hello from backbone!');
window.App = window.ScratchPad
$(document).ready ->
ScratchPad.initialize()
rails s
root 'application#index'
to config/routes.rbNotice our greeting from Backbone "Hello From Backbone!"
Commit!