Gerald Vim wrote in post #1146378:
> Using Rails 4.1.1 this command:
>
> rails g scaffold Main home contact events about
>
> .... generates:
>
> app/controllers/mains_controller.rb
>
> Why has 's' been appended? This didn't happen with 4.1.0.

Did you mean "rails g controller main home contact event about"?

If you use scaffold Rails with generate based on "Main" being a model 
first then generate a controller and views based on the model name 
pluralized based on inflections database.

It also seems really odd to me your choice of methods to add to your 
controller. Shouldn't "home", "contact", "events" and "about" have their 
own controllers with their own routes?

$ rails g controller main home contact events about
      create  app/controllers/main_controller.rb
       route  get 'main/about'
       route  get 'main/events'
       route  get 'main/contact'
       route  get 'main/home'
      invoke  erb
      create    app/views/main
      create    app/views/main/home.html.erb
      create    app/views/main/contact.html.erb
      create    app/views/main/events.html.erb
      create    app/views/main/about.html.erb
      invoke  test_unit
      create    test/controllers/main_controller_test.rb
      invoke  helper
      create    app/helpers/main_helper.rb
      invoke    test_unit
      create      test/helpers/main_helper_test.rb
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/main.js.coffee
      invoke    scss
      create      app/assets/stylesheets/main.css.scss

$ rake routes
      Prefix Verb URI Pattern             Controller#Action
   main_home GET  /main/home(.:format)    main#home
main_contact GET  /main/contact(.:format) main#contact
 main_events GET  /main/events(.:format)  main#events
  main_about GET  /main/about(.:format)   main#about

I suppose this would work, but still seems quite add to me.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b9ab11c571f0d2fe348a83d77bf7fc20%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to