Richard Williams wrote:> I''ve a controller method called "dofind" in my
controller class:
>
> def dofind
> @abc = "123"
> end
>
> And a view called "dofind.rhtml" which contains:
>
> Hi <br>
> <%= @abc %>
>
>
> When I run the dofind method I can see the "Hi" from the view but
not
> the value of abc.
>
> If I add a abc.inspect it outputs "nil"
>
> How in the heck do you do this?
>
> Richard
Firstly, this is not a constant as a ruby constant. Constants start with an
uppercase letter.
Is this really the entire code? As far as I can see, it should work fine. I just
tried it here, no problems whatsoever.
When you "run" the dofind method, I assume you mean you do
"http://host/bla/dofind"?