is it possible in ruby to create dynamic variables like in php by doing
$b=$$a ??
i'd like to infer an instance variable from a layout view, in order to
set up dynamically a precise id to my html object (so i need the name
of the current objetc + its id)
is it possible in ruby to create dynamic variables like in php by doing
$b=$$a ??
i'd like to infer an instance variable from a layout view, in order to
set up dynamically a precise id to my html object (so i need the name
of the current objetc + its id)
This was the way I dicovered arrays back when I was 11 years old. I
kept trying to concatenate a number with a fix variable name in some
version of basic.
Lucas.
···
On Jun 20, 3:23 am, Robert Klemme <shortcut...@googlemail.com> wrote:
On 20.06.2008 00:51, nico Itkin wrote:
> is it possible in ruby to create dynamic variables like in php by doing
> $b=$$a ??
> i'd like to infer an instance variable from a layout view, in order to
> set up dynamically a precise id to my html object (so i need the name
> of the current objetc + its id)
This is usually an indication that you rather want a Hash.