Generate Static Pages in Rails
Often times you'll need to generate static pages in your Rails application. These pages don't require to have object classes of models to relay on for data. These pages may simply be 404 Error pages with some static content. In other words, we are creating view without model in Rails 4.
Rails doesn't provide you with any specific generators, but rather relies on generic generate controller method. All you'll need in order to generate static pages in Rails is to run the following command line and adding Controller name as well as static pages as actions right after.
> rails generate controller StaticPages home help 404
You'll end up with StaticPages Controller and three pages home.html.erb, help.html.erb and 404.html.erb