Nirma
Nirma

Reputation: 5790

Ruby on Rails only showing what is in public folder

I am new to rails and have developed a simple rails application on my machine that works when hosted locally with WEBrick.

I understand that you need to delete index.html from the public folder and set the proper root in config/routes.rb to point to the controller you wish to be root, which I did with:

 root :to => 'home#index'

(On the remote host)

When I have the index.html file in the public folder and go to mywebsite.com/myapp I see the page. When I delete the index.html page from the public folder I get a 404 and my app does not run.

Any idea as to why my app is not running when I deploy it to the remote host?

Upvotes: 1

Views: 550

Answers (1)

jnevelson
jnevelson

Reputation: 2092

If you set your root to home#index, then you need to have a view app/views/home/index.html.erb. The corresponding controller method would be def index, located in app/controllers/home_controller.rb.

Upvotes: 1

Related Questions