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” 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
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.
On Apr 12, 2:41 pm, Jump J. [email protected]