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.
on 2007-06-11 21:00
on 2007-06-11 21:22
I think that's just a Rails standard...I could be wrong though.
on 2007-06-11 21:29
On Jun 11, 2:21 pm, longint <michael.me...@gmail.com> wrote: > > Thanks.- Hide quoted text - > > - Show quoted text - What is the standard? Is there a definition somewhere how the names change?
on 2007-06-11 21:46
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 <firstname.lastname@example.org> wrote: > -- 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
on 2007-06-11 21:46
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) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)
on 2007-06-12 17:12
On Jun 11, 2:45 pm, "Chris Johnston" <fuzzyliz...@gmail.com> wrote: > > -- Antoine de Saint-Exupery The name of controller is hello_world instead of helloworld. Thanks.