Desk2Mob

Desk2Mob

Desk2Mob

  • Rails starts its web server on port 3000 by default. If you want to use another port, such as 8888, execute below command
ruby script/server -p 8888
Posted on February 03, 2014 by Amit Pandya in Rails

  • A model just genenates the model. Scaffold generates a controller and views too.
./script/generate model mymodelname

creates an activerecord model that is usually linked to a database but doesn't have to be.

./script/generate scaffold scaffoldname 

creates a model, a controller, a layout, some css styles etc. This gives you the model plus everything else...

Posted on February 03, 2014 by Amit Pandya in Rails

<% .... %>  is Scriptlet

&

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

  • If you have multiple Rails versions installed on your application and if you want to create Rails application using below command
rails demo_apps
  • In this case, it will create Rails application "apps" with latest version installed on our machine.

  • If you want to create Rails application for specific rails versions, use below command

rails _x.x.x_ <appn... 
Posted on February 03, 2014 by Amit Pandya in Rails

  • To rollback your most recent migration, execute below command
    rake db:migrate:rollback
  • If you want to rollback specific migration, you need to execute below command
    rake db:migrate VERSION=<version to rollback to>
Posted on February 03, 2014 by Amit Pandya in Rails