Platinum Partner

Rails Generator Syntax

// generate application

rails projectname


// generate migration.

ruby script/generate migration migration_name
ruby script/generate migration add_price


// generate model
// we can give a list of columns and types
// :string, :text, :integer, :decimal, :float, :date, ...

ruby script/generate model model_name
ruby script/generate model user name:string hashed_password:string salt:string


// generate controller

ruby script/generate controller controller_name method_name(s)
ruby script/generate controller store index


// generate scaffold

ruby script/generate scaffold model_name controller_name
ruby script/generate scaffold product admin
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}