Skip to content

Conversation

tyraeltong
Copy link

One example:

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:

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.

@rohitnair
Copy link

I faced the same issue with multiple word model names as well. The fix mentioned here seems to work. Might be a good idea to merge this in?

@johnmcaliley
Copy link

+1 for merging this

@seabre
Copy link

seabre commented May 22, 2012

+1 as well. Please merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants