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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4710a8ada2adc162aaee4288d9879d8e?d=identicon&s=25 Gerard (Guest)
on 2006-01-04 23: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
`controller_path'

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

Thanx!

Gerard.

On Wednesday 04 January 2006 18:58, Kevin Olbrich tried to type
something
like:
> 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;
~
:wq!
This topic is locked and can not be replied to.