Question: I have generated a rails 5 api application. But I want my app with home page. For that I generated a home controller and added view file i respective views/home/index.html.erb

But when I tried accessing it I am getting below response

> 
> Started GET "/home/index" for 127.0.0.1 at 2016-07-14 11:14:03 +0530
>  Processing by HomeController#index as HTML Completed 204 No Content in
>  0ms
> 
> 
> Started GET "/home/index.js" for 127.0.0.1 at 2016-07-14 11:14:20
>  +0530 Processing by HomeController#index as JS Completed 204 No Content in 0ms
> 
> 
> 

But I could not see index page content displayed on the web.

Kindly share your thoughts.

Answer: 
**Just to add to [Risto Keravuori's answer](https://stackoverflow.com/a/38406528/10907864)**

I had to create a **home controller** in the `app/controllers` directory:

```
app/controllers/home_controller.rb

```

Next, I added the following content to it:

```
require 'rails/application_controller'

class HomeController < Rails::ApplicationController
  def index
    render file: Rails.root.join('public', 'index.html')
  end
end

```

Then, I created an **index.html** file in the `public` directory:

```
public/index.html

```

Next, I added the following content to it:

```
<head>
  <title>My API</title>
</head>
<body>
    <h1>My API</h1>
    <p>Welcome to my API</p>
</body>

```

**Note**: You can modify the index.html file based on your choice.

Lastly, I added the routes to the `config/routes.rb` file, below all the already defined routes.

```
get '*other', to: 'home#index'

```

**Note**: Do not put it inside a namespace say, `api` namespace or `api/v1` namespace. Just put it at the bottom of the file but inside the `Rails.application.routes.draw do` block.

You can restart your server and test it out.

That's all.

**I hope this helps**
If all you need is just a static HTML page (with some simple css/js), i think another method is just to edit the `index.html` page under `public` folder.