codebrew/backbone-rails — Issue #64: router template incorrect when the model name composes of more than 1 word
Author: tyraeltong
Created: 2011-11-17 05:14:30+00:00
State: open

One example:
```ruby
rails g scaffold TestCase name:string content:string
rake db:migrate
rails g backbone:scaffold TestCase name:string content:string
```
the router gets generated would be like:
```ruby
class AppName.Routers.TestCasesRouter extends Backbone.Router
initialize: (options) ->
@testCases = new AppName.Collections.TestCasesCollection()
@testCases.reset options.testCases
...
newTestCase: ->
@view = new AppName.Views.TestCases.NewView(collection: @test_case)
...
index: ->
@view = new AppName.Views.TestCases.IndexView(test_case: @test_case)
```

While it should stick to camel name convention for js code, use testCase instead of test_case. And there're some other part of the code is using something like options.testCases but here you passed in test_case hence the problem like 'bind' is not a function on 'undefined' would happen.

It's very simple to fix, I created a fork and will send the pull request.