giant robots smashing into other giant robots

Written by thoughtbot

jasonmorrisontb

Backbone.js on Rails at Boston.rb

On Tuesday I gave a Backbone.js on Rails talk at the Boston Ruby Group. Video and slides are now online.

What’s in the talk

In the 45-minute talk, I discussed:

  • Why would you use a client-side framework?
  • What are some such frameworks? How might you decide among them?
  • An overview of the moving parts of Backbone.js
  • Following a page load from the Rails request and response to Backbone initialization, routing, dispatch, and rendering.
  • Briefly, the integration points between Backbone.js and Rails such as the asset pipeline and JSON APIs

What’s not

There are a few topics included in the slides that I didn’t cover in the video, in the interest of time:

  • How to apply integration and isolation testing for apps with Javascript
  • Using pushState with Backbone.js and Rails
  • How to keep multiple clients’ data in sync (polling, push)

Find more in the book

We cover all these topics (and others) in more depth in the Backbone.js on Rails eBook.

Any questions from the talk you didn’t get to ask that night? Purchasing the eBook before we release the first edition means you can request particular topics to be covered in the book.

If you’re a little more pressed for time with your question, I’ve found the backbonejs Google Group to be a great place to discuss Backbone and different usage scenarios.

jasonmorrisontb

Bring your laptop, get started with Ruby at Tuesday’s Boston.rb meetup

Well, howdy there!

Interested in Ruby?

Have you been…

…interested in building web application, but aren’t sure where to start? We’ve all been beginners once, so let us lend a hand!

…seeking a technical co-founder, but finding it difficult? Investing the time to learn programming will do wonders. You’ll be better equipped to sniff out quality developers, and quite possibly knock out a prototype on your own.

…teaching yourself Ruby or self-studying on Rails and running into questions? Rubber Ducking can help, but it’s not nearly as much fun as meeting your fellow Boston Rubyists.

…programming Ruby or Rails for a little while (or a long while) and are looking to help teach and welcome new folks to the community?

Let’s meet up!

Drop by the thoughtbot office this Tuesday, October 4, at 7pm. We’ll be hosting a structured session on getting your laptop set up for Ruby development. We’ll be following the process described here and be available for debugging:

2011 Rubyist’s guide to a Mac OS X development environment

Please RSVP to the event so we know how much food and how many drinks to get. We’re happy to field questions ahead of time in the comments below, or you can sign up for the Boston Ruby mailing list, mosey over to the email thread for this meetup, and say hello!

Introduction to using vim for Rails development

Someone recently asked us to do “vim on Rails” screencasts.

So, we’re responding with this experiment. Let us know if this is valuable and we’ll try to improve things like audio quality.

Install Joe Ferris’ config files

git clone git://github.com/jferris/config_files.git
cd config_files
./install.sh

Installing vim

If you’re on a UNIX machine, you probably have vi. You may also have vim. Try running vim from the command line.

Many of us on Apple laptops prefer MacVim. Download the installer.

It’s nice to have the mvim command from your shell, so copy it from wherever your downloaded MacVim to into a place where you keep scripts. I use ~/bin:

cp ~/Downloads/MacVim-7_2-stable-1_2/mvim ~/bin

rails.vim

The grandaddy vim plugin we use as Rails developer’s is Tim Pope’s rails.vim. Read the rails.vim documentation.

Basic commands

Move to a file in your app:

:Rmodel user
:Rcontroller application
:Rhelper navigation
:Rview sessions/new
:Rfunctionaltest sessions
:Runittest user

Go to the alternate file:

:A

Go to the file under cursor:

gf

Enter into insert mode:

i

Exit insert mode:

esc

Open and close folded code (mnemonic is imagining the Z as tractor feed printer paper and o for open, c for closed) :

:zo
:zc

dancroak

Boston.rb redesign

Boston.rb was recently re-designed. It went from this…

Boston.rb old

… to this:

New Boston.rb

I know, I know… you’re thinking: that must have cost a fortune! What’d you do, hire Sterling Cooper?

Nope. I’ll let you in on a little secret but I want you to hold on to your horses… it cost $0 to redesign.

Bucking Bronco

That’s right. It was done using a new-fangled technique called “open source.”

Boston.rb code review

After the redesign, I lead a code review of the Boston.rb source at the Boston Apple Store.

Apple Store code review of Boston.rb

All the slides are available online. You will need to register to see them.