The idea is: when I select a “product” I want to show the price of
that product automatically in the “price” text-field. I have a table
where I store the price of each product.
Why would you think prototype code would work in a jquery app? What
version of rails are you using? What have you done to setup your app
for jquery? Why did you think that information was unnecessary? Aren’t
you aware that rails changes every week?
Why would you think prototype code would work in a jquery app?
I tried the example in an app with prototype (not jquery), but it
didn’t work, that’s the reason I’m looking for a jquery way
What version of rails are you using?
Version 3.0.9
What have you done to setup your app for jquery?
I’ve installed jquery-rails gem
Why did you think that information was unnecessary?
I didn’t, I’ve made a mistake, sorry
Aren’t you aware that rails changes every week?
I know rails changes, but I didn’t know it changes that often!!.
Can you post your form tag? And your associations? I don’t
understand your
collection_select at all. Of course, I find trying to understand
collection_select to be harder than learning C++ to an intermediate
level. In fact, if I had 10,000 's, it would be faster for me
to write them out by hand than trying to figure out what arguments
collection_select takes.
and put it in the public/javascripts directory. Name the file
jquery.rails.js. Note how the javascript_include_tag below links to
that file as well as google:
Note the change to the javascript_include_tag–it will link to the file
public/javascripts/rails.js, which is the prototype file that rails
generates automatically: