Desk2Mob

Desk2Mob

Desk2Mob

  • A model just generates the model. Scaffold generates a controller and views, too.

./script/generate model mymodelname

  • creates an ActiveRecord model that is typically connected to a database, but doesn't have to be.

./script/generate scaffold scaffoldname</pre... 
Posted on February 03, 2014 by Amit Pandya in Rails2

  • Rails starts its web server on port 3000 by default. If you want to use a different port, such as 8888, run the command below.

ruby script/server -p 8888
Posted on February 03, 2014 by Amit Pandya in Rails2

  • If you have multiple Rails versions installed on your application, and if you want to create a Rails application using the command below
rails demo_apps

  • In this case, it will create a Rails application "apps" with the latest version installed on our machine.

  • If y...

Posted on February 03, 2014 by Amit Pandya in Rails2

<% .... %> is Scriptlet 

and

<%= ... %> is Expression 
Posted on February 03, 2014 by Amit Pandya in Rails2

  • To rollback your most recent migration, execute the command below

rake db:migrate:rollback
  • If you want to rollback a specific migration, you need to execute the command below

rake db:migrate VERSION=
Posted on February 03, 2014 by Amit Pandya in Rails2