All of the Rails tutorials I’ve looked at seem to revolve around creating a new database and then making the contents of the database accessible through the web page. The URL http://localhost:3000/users gives you access to the user list after you enter the following commands:
rails generate scaffold User name:string email:string
But what if you already created the user database with data in it? What is the alternative procedure for providing access to the user database at http://localhost:3000/users ?
that comment will generate controller, model and migration(used to create table), you can generate them separately
see this command will not generate the database this will generate the table name user , if you want to change the database go to the database.yml to change the database name.
Just delete the migration file generated, and don't run the rake
commands. Alternatively just use generate model and generate
controller and write the rest yourself (or just write it all
yourself). If you use generate model then again delete the migration
That all assumes the existing table is rails compatible of course.