Just a feedback

Hello !

If you want to create models, views and controllers using the command
line “sudo ruby ./script/generate scaffold book test”
and rails is plugged to an existing database which tables are named in

Don’t forget that Rails will search a table named “books” even if you
specify the table name “book” without “s”.
Rails will return the error “Before updating scaffolding from new DB
schema, try creating a table for your mode”
Even if the name of the table is matching the name of the model
specified in the command line

If you want to deactivate this behaviour, in case of testing RoRs with
your existing database, you must add in your environment.rb file the
following variable :
ActiveRecord::Base.pluralize_table_names = false


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs