# Index.html.erb

**URL:** <https://www.ruby-forum.com/t/index-html-erb/134613>\
**Category:** Rails\
**Created:** [April 12, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/index-html-erb/134613 "2008-04-12T23:41:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jump](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/47e85d/32.png) [@jump](https://www.ruby-forum.com/u/jump)\
**Post date:** [April 12, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/index-html-erb/134613/1 "2008-04-12T23:41:28Z")

</div>

Hi Everyone,

A newbie question, I have my subdomain pointing to th respective  
app/views folder however the browser does not default to the  
index.html.erb , so instead I just have file listing. When I click on  
the index.html.erb it does work fine. What do I need to do to get it to  
work so it automatically load when a user goes to that view folder.

Thanks in advance

Using ROR 2.2

---

<div class="post-metadata">

**Author:** ![jump](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/47e85d/32.png) [@jump](https://www.ruby-forum.com/u/jump)\
**Post date:** [April 13, 2008, 11:42am UTC](https://www.ruby-forum.com/t/index-html-erb/134613/2 "2008-04-13T11:42:09Z")

</div>

You should not be directly accessing your views from the browser.  
Instead, your subdomain should go to the public folder (instead of app/  
views). Here’s the basic flow for a Rails app:

The browser goes to the public folder. The dispatcher in that folder  
(automatically generated with the rest of the Rails app) will be  
called and given the URL of the browser’s request. Assuming the URL  
isn’t for some static file within the public folder (e.g. an image or  
CSS file), the dispatcher will route the request to an action within a  
controller. It decides which controller and action to go to based on  
the URL. Be default, “[subdomain.yoursite.com/apple/orange](http://subdomain.yoursite.com/apple/orange)” will call  
the apple controller and the orange action.

Inside the controller file, a method with the same name as the  
specified action will be run. So in the previous example, the orange  
method will be called in the app/controller/apple\_controller.rb file.  
Once the orange method has finished executing, Rails will then render  
app/views/apple/orange.html.erb.

If that isn’t working, you probably have to either set up FastCGI or  
start up a WEBrick or Mongrel server. Let us know what your setup is  
and we can probably help you out there.

– Andrew

On Apr 12, 2:41 pm, Jump J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
