# Ruby on start page?

**URL:** <https://www.ruby-forum.com/t/ruby-on-start-page/122712>\
**Category:** Rails\
**Created:** [December 11, 2007, 5:27am UTC](https://www.ruby-forum.com/t/ruby-on-start-page/122712 "2007-12-11T05:27:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 11, 2007, 5:27am UTC](https://www.ruby-forum.com/t/ruby-on-start-page/122712/1 "2007-12-11T05:27:26Z")

</div>

As stated, I am new to rails, and Runy for that matter. I am working  
on a simple project to get acquainted and wanted to use ruby code in  
index.html, I changed the name to .rhtml and added the following  
simple code:

\<% link\_to ‘Artists’, :action =\> ‘list’ %\>

This works great in my view files, but in the index.rhtml file, not so  
much. The error is:

“uninitialized constant WelcomeController”

What should I be doing differently?

Thanks,

Mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 11, 2007, 6:22am UTC](https://www.ruby-forum.com/t/ruby-on-start-page/122712/2 "2007-12-11T06:22:58Z")

</div>

You shouldn’t be using the index.html file in the public folder inside  
your  
application’s root directory. This is just something to display for when  
you  
have nothing at the beginning.

In your config/routes.rb I’m guessing you’ve defined something like:

map.connect ‘’, :controller =\> “welcome”

Because that is what’s commented out by default in the config/routes.rb  
file.

The error you’re getting is generated from Rails looking for a  
controller  
file called “welcome\_controller.rb” in app/controllers, the file is not  
there and Rails throws a nice error. To generate the controller type  
script/generate controller welcome.

As of Rails 2.0 controller names should be pluralized. This is extremely  
helpful for when you get to “RESTful Routing” because typing out stuff  
like  
new\_post\_comment\_path is much better than :controller =\> “comments”,  
:action  
=\> “new”, :post\_id =\>

depending on what kind of application you’re making, think of what the  
first  
object should be and pluralize the name, and type script/generate  
controller  
\<object’s pluralized name\>. You will also need to generate a model for  
your  
object, and this name should be singular.

On Dec 11, 2007 10:21 AM, Mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “uninitialized constant WelcomeController”
> 
> What should I be doing differently?
> 
> Thanks,
> 
> Mike
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 11, 2007, 8:18am UTC](https://www.ruby-forum.com/t/ruby-on-start-page/122712/3 "2007-12-11T08:18:49Z")

</div>

Are you advising dont use index.html at all? I got rid of the  
standard one and made my own but maybe that wont work. I have 3  
tables with model, view, and controller files setup as needed. I just  
want a start page that allows me to summarize the tables (counts,  
etc.) and provide links into their views. Is it best to create some  
new object called “start”?

Thanks for quick response!

Mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 11, 2007, 8:21am UTC](https://www.ruby-forum.com/t/ruby-on-start-page/122712/4 "2007-12-11T08:21:12Z")

</div>

Perhaps going through a few screencasts might give you a better idea of  
how  
Rails works.

> **[The First Rails 2.0 Screencast | AkitaOnRails.com](https://www.akitaonrails.com/2007/12/10/the-first-rails-2-0-screencast-english)**
>
> Update 2013: This screencast is obviously obsolete (this is Rails 2 and Rails is already at version 4). It’s maintained here for historical reasons...

> **[Ruby on Rails Screencasts - RailsCasts](http://railscasts.com)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

On Dec 11, 2007 12:47 PM, Mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Mike
> 
> > map.connect ‘’, :controller =\> “welcome”  
> > As of Rails 2.0 controller names should be pluralized. This is extremely  
> > \<object’s pluralized name\>. You will also need to generate a model for
> > 
> > > on a simple project to get acquainted and wanted to use ruby code in  
> > > What should I be doing differently?
> > 
> > > Thanks,
> > 
> > > Mike
> > 
> > –  
> > Ryan B.[http://www.frozenplague.net](http://www.frozenplague.net)

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!
