# Newbie question - HelloWorld

**URL:** <https://www.ruby-forum.com/t/newbie-question-helloworld/106548>\
**Category:** Rails\
**Created:** [June 11, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548 "2007-06-11T21:00:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/1 "2007-06-11T21:00:14Z")

</div>

When I created a rails project as ‘HelloWorld’ and a controller as  
‘HelloWorld’, ruby created control called hello\_world instead of  
HelloWorld. Why is that? Why is it not using the name I am providing  
to create?  
Thanks.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:22pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/2 "2007-06-11T21:22:23Z")

</div>

I think that’s just a Rails standard…I could be wrong though.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/3 "2007-06-11T21:29:24Z")

</div>

On Jun 11, 2:21 pm, longint [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Thanks.- Hide quoted text -
> 
> - Show quoted text -

What is the standard? Is there a definition somewhere how the names  
change?

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:46pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/4 "2007-06-11T21:46:30Z")

</div>

Hi –

On Mon, 11 Jun 2007, DBC User wrote:

> > > When I created a rails project as ‘HelloWorld’ and a controller as  
> > > ‘HelloWorld’, ruby created control called hello\_world instead of  
> > > HelloWorld. Why is that? Why is it not using the name I am providing  
> > > to create?  
> > > Thanks.- Hide quoted text -
> > 
> > - Show quoted text -
> 
> What is the standard? Is there a definition somewhere how the names  
> change?

It’s all done according to Ruby conventions/traditions. If you  
generate a controller called HelloWorld, you’ll get a file called  
hello\_world\_controller.rb, with a class called HelloWorldController  
defined inside it. That’s in keeping with Ruby file-naming and  
class-naming conventions.

Similar things will happen with models: if you generate a Thing model,  
you’ll get things.rb with class Thing inside it.

David

–

- Books:  
RAILS ROUTING (new! [http://safari.awprofessional.com/9780321509246](http://safari.awprofessional.com/9780321509246))  
RUBY FOR RAILS ([Ruby for Rails](http://www.manning.com/black))
- Ruby/Rails training  
& consulting: Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 12, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/5 "2007-06-12T17:12:11Z")

</div>

On Jun 11, 2:45 pm, “Chris Johnston” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> – Antoine de Saint-Exupery  
> The name of controller is hello\_world instead of helloworld.  
> Thanks.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 11, 2007, 9:46pm UTC](https://www.ruby-forum.com/t/newbie-question-helloworld/106548/6 "2007-06-11T21:46:30Z")

</div>

Is the controller named hello\_world or just the file? My guess is that  
on  
the filesystem you have a file called hello\_world\_controller.rb, but if  
you  
look inside at the first line where it defines the class, it is probably  
called HelloWorld.

Chris

On 6/11/07, DBC User [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

–  
[www.fuzzylizard.com](http://www.fuzzylizard.com)

You know you’ve achieved perfection in design, Not when you have nothing  
more to add, But when you have nothing more to take away.  
– Antoine de Saint-Exupery
