make = cgi.params[‘make’]
function someFunc(str_string)
}
How do I dereference a Javascript var?
Any input would be great!
Thanks
Hi,
you’re mixing two things:
server-side ruby (i.e. it runs on server)
client side javascript (runs on client in browser)
The control flow is as follows:
server takes your page, runs the embedded ruby, and replaces it
with the result.
xxx<%= ‘a’ + ‘b’ %>xxx is the same as xxxabxxx (except for possible
newlines, but we don’t care now)
the page is sent to browser, and displayed. javascript is executed.
now the page doesn’t contain any ruby code.
Your problem with js_string is that there’s no javascript involved
when ruby is run, and vice versa. What you have to do is to create a
form and send the data back to the server for processing - see your
year, make, category.
when ruby is run, and vice versa. What you have to do is to create a
form and send the data back to the server for processing - see your
year, make, category.- Hide quoted text – Show quoted text -
I gotcha.
I’m still learning this stuff.
Thanks for the direction.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.