How to pass HTML Field value to Ruby code in view

Hello,

I need to get a value of HTML Hidden field inside my Ruby Code in view:
I’m storing session variable name inside hidden field which I need to
access from different blocks of Ruby code:

<% if sessions[VAR_NAME].nil? %>

VAR_NAME is the value of the hidden field. I tried using the $(’’)
notation and document.getElementById but it’s doesn’t render from inside
Ruby block.

Any ideas how I can pass the value to Ruby Block?

Thanks,

Tam

On Wed, Apr 1, 2009 at 1:24 AM, Tam K.
[email protected] wrote:

I need to get a value of HTML Hidden field inside my Ruby Code in view:
I’m storing session variable name inside hidden field which I need to
access from different blocks of Ruby code:

<% if sessions[VAR_NAME].nil? %>

Rails sessions are called “session”, singular.

Session keys are symbols, not constants.

session[:var]


Greg D.
http://destiney.com/