Generating a view from a controller

Hello everyone,

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.

2009/7/15 s.ross [email protected]:

Rails server with PostgreSQL. No i am on windows server 2003 R2

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”

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

Colin.

Hello–

On Jul 14, 2009, at 9:50 PM, crazy canuck wrote:

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs