Forum: Ruby on Rails Simple print statement (was: recongizing the current control

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Gerard (Guest)
on 2006-01-05 00:08
(Received via mailing list)
All (and kevin),

After flying high for a while on Rails things, I'm down to the nitty
gritty of
Ruby stuff. Messing with vars and printing them out on a web page.

I found the controller_path in the API docs;

However when putting this in a controller:

@test1 = controller_class_name
@test2 = controller_name
@test3 = controller_path

And this in a partial:

Test1 <%= @test1 %><br/>
Test2 <%= @test2 %><br/>
Test3 <%= @test3 %><br/>

I get this in my browser:

Test1 MainController
Test2 main

On the third one I get a: undefined local variable or method

Is there a difference with the 1st and 2nd? Is this a faulty application
to do



On Wednesday 04 January 2006 18:58, Kevin O. tried to type
> Gerard wrote:
> > Is there a way to point out the module (or controller group if you will)
> > I'm
> > in?
> >
> > Thanx!
> I think controller.controller_path might give you 'module/controller'

"Who cares if it doesn't do anything?  It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..."

My $Grtz =~ Gerard;
This topic is locked and can not be replied to.