Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember route not generated with the resource generator #321

Open
steveklabnik opened this issue Nov 30, 2013 · 1 comment
Open

Ember route not generated with the resource generator #321

steveklabnik opened this issue Nov 30, 2013 · 1 comment

Comments

@steveklabnik
Copy link

Check it:

$ bin/rails g resource Customer2 name:string  --no-helper                                                                                                 
      invoke  active_record                                                                                                                                        
      create    db/migrate/20131130193948_create_customer2s.rb                                                                                                     
      create    app/models/customer2.rb                                                                                                                            
      invoke  controller                                                                                                                                           
      create    app/controllers/customer2s_controller.rb                                                                                                           
      invoke    erb                                                                                                                                                
      create      app/views/customer2s                                                                                                                             
      invoke  resource_route                                                                                                                                       
       route    resources :customer2s                                                                                                                              
      create  app/serializers/customer2_serializer.rb                                                                                                              
      invoke  ember:model                                                                                                                                          
      create    app/assets/javascripts/models/customer2.js                                                                                                         
      invoke  ember controller and view (singular)                                                                                                                 
      create    app/assets/javascripts/views/customer2_view.js                                                                                                     
      invoke  ember controller and view (plural)                                                                                                                   
      create    app/assets/javascripts/views/customer2s_view.js  

It should be: https://github.com/emberjs/ember-rails/blob/master/lib/generators/ember/resource_generator.rb#L21

Unsure what's going on here.

@rwjblue
Copy link
Member

rwjblue commented Nov 30, 2013

We have two different ways that we generate a resource: we override Rails' default ResourceGenerator in Ember::Rails::ResourceGeneratorOverride here and the normal ember:resource generator (Ember::Rails::ResourceGenerator) is here.

These two mechanisms have not been kept in sync, and parts of both need to updated. I am working on a refactor that will make the ResourceGeneratorOverride simply invoke the ember:resource generator, and also update ember:resource to create the proper layout of files that you would expect (currently it only creates a singular named template/controller/route/model for the given name).

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

No branches or pull requests

2 participants