Is there a way, using rails generators, to create a controller with RESTful routes?
Generating a controller and specifying the action name creates a controller and adds a route to config/routes.rb, but create is a get:
$ rails g controller foos new create
  create  app/controllers/foos_controller.rb
   route  get "foos/create"
   ...
I'd prefer to see route post "foos", but don't see anything useful in rails g controller --help
Try using rails generate scaffold_controller Foos
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With