On running a freshly created app, we get default rails page( printed below, which signifies our server is running perfectly alright). But actually this page is none of our use.
We can simply replace this page with any page as per our need.
Create a project first:
$ rails new DemoApp
$ rails g scaffold blog title:string description:text
$ rake db:migrate
$ rails s
Now open link http://localhost:3000/
We will get following page :
2. open config/routes.rb and add following line
DemoApp::Application.routes.draw do
resources :blogs
root :to => “blogs#new” # I want to set blogs/new.html.erb as my #root page.
end
3. Now just restart your server (rails s) & enter localhost:3000/ in your web browser. (Your configuration for root won’t work until you restart your server)