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 :
Follow below 3 steps and set any page as your root page :1. Remove the index.html file located at app/public/index.html (manually delete it)
2. open config/routes.rb and add following line
root :to => “blogs#new” # I want to set blogs/new.html.erb as my #root page.
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)