Search code examples
ruby-on-railsruby-on-rails-3scaffoldingscaffold

How can I make scaffold only for controller and views if model already exists?


I already have set up Devise to My App.
So User model is already generated, and exists by installing Devise

Now I'd like to add my own controller users_controller.rb and its views index and show.
How can I make scaffold without affecting to User model that already exists?


Solution

  • For scaffold with only 'name' column:

    rails g scaffold User name --skip
    

    Just add some columns.

    Look to rails g scaffold -h output for additional information.