# generating a view from a controller.

**URL:** <https://discuss.rubyonrails.org/t/generating-a-view-from-a-controller/44260>\
**Category:** rubyonrails-talk\
**Created:** [July 15, 2009, 4:50am UTC](https://discuss.rubyonrails.org/t/generating-a-view-from-a-controller/44260 "2009-07-15T04:50:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![crazy\_canuck](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@crazy\_canuck](https://discuss.rubyonrails.org/u/crazy_canuck)\
**Post date:** [July 15, 2009, 4:50am UTC](https://discuss.rubyonrails.org/t/generating-a-view-from-a-controller/44260/1 "2009-07-15T04:50:07Z")

</div>

Hello everyone,

&nbsp;&nbsp;&nbsp;&nbsp;My name is Brandon. I have just finished setting up a ruby on Rails server with PostgreSQL. No i am on windows server 2003 R2 service pack 2.

I can create an app, and seems like create a controller....

ruby script/generate controller hello index

but when i type localhost:3000 all i get is the "welcome aboard, your riding Ruby on Rails."

home screen not my Hello#index page.

any help would be much appreciated, thanks in advance.

---

<div class="post-metadata">

**Author:** ![Steve\_Ross](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Steve\_Ross](https://discuss.rubyonrails.org/u/Steve_Ross)\
**Post date:** [July 15, 2009, 5:38am UTC](https://discuss.rubyonrails.org/t/generating-a-view-from-a-controller/44260/2 "2009-07-15T05:38:35Z")

</div>

Hello--

> Hello everyone,
> 
> &nbsp;&nbsp;&nbsp;My name is Brandon. I have just finished setting up a ruby on Rails server with PostgreSQL. No i am on windows server 2003 R2 service pack 2.
> 
> I can create an app, and seems like create a controller....
> 
> ruby script/generate controller hello index
> 
> but when i type localhost:3000 all i get is the "welcome aboard, your riding Ruby on Rails."
> 
> home screen not my Hello#index page.
> 
> any help would be much appreciated, thanks in advance.

Good news! You have your server running. Now you need to delete public/index.html which is just a placeholder page and the one you are currently seeing. You also have to modify config/routes.rb to include something like:

map.root :controller =\> "hellos"

That tells the Rails routing system that the root of your application (where someone goes if they go to '/') should be to the default action in the HellosController. If your controller is really called HelloController, then:

map.root :controller =\> "hello"

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Colin\_Law1](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_Law1](https://discuss.rubyonrails.org/u/Colin_Law1)\
**Post date:** [July 15, 2009, 8:41pm UTC](https://discuss.rubyonrails.org/t/generating-a-view-from-a-controller/44260/3 "2009-07-15T20:41:53Z")

</div>

It might well be worth while having a look at the Ruby on Rails guides at [http://guides.rubyonrails.org/](http://guides.rubyonrails.org/), particularly Getting Started with Rails.

Colin.
