Ruby on Rails has three environment. So there has three command set environment of your Ruby on Rails.

1. set RAILS_ENV=production
2. set RAILS_ENV=development
3. set RAILS_ENV=test

Ruby on Rails development mode work as a default environment.

#Create Rails controller and action/function/method name command
rails generate controller controllerName action1 action2 action3
#Create Rails model and their fields name command
rails generate model modeleName fieldName:dataType fieldName:dataType

#Creating the Database command
rake db:create
#Database migrate command
rake db:migrate

#Starting up the Web Server command
rails server or rails s

Blog::Application.routes.draw do

#…
# You can have the root of your site routed with “root”
# just remember to delete public/index.html.
root :to => “home#index”

The root :to => “home#index” tells Rails to map the root action to the home controller’s index action.

continue………………………..

Advertisements