You may want to use Ruby's instance_variable_get(...) like this:
tag 'my_instance_variable' do |tag|
tag.globals.page.instance_variable_get('@my_instance_variable')
end
On 12/13/07, Dave Bryand <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to figure out how to access the value of an instance variable
> that gets setup on SiteController when my extension is activated. I'd
> like to use this value in a tag, but I can' figure out how to access
> that variable from the tag.
>
> If I setup a tag that just dumps the page.inspect, like the tag below, I
> can see the instance variable in the output, but I just can't figure out
> how to grab it.
>
> ----------------
> tag 'inspect_page' do |tag|
> tag.globals.page.inspect
> end
> ----------------
>
> I'd like to be able to do something like
>
> ----------------
> tag 'my_instance_variable' do |tag|
> # @my_instance_variable is defined in SiteController on extension
> activation
> tag.globals.page.my_instance_variable
> end
> ----------------
>
> Anyone know how to do this?
>
> Thanks!
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant