Using Javascript on Ruby on rails

I try to use some calculations every time a user changes a text field. I have many questions about how to find out the id text field, how to save it in a variable, etc. I am new to ruby ​​and javascript and there are a lot of questions. Could you tell me where I can find additional information that explains step by step how to do this?

Many thanks.

+3
source share
1 answer

I highly recommend using jQuery with Ruby on Rails ... it makes it much easier and will be standard, as in the next version (3.1).

In jQuery you are doing something like:

$('#my_field').change(function() {
  $('#result').val(function() {
    do something...
  });
});

js.erb Ruby JS . Ryan Bates Railscasts Javascript RoR .

, NetTuts + JavaScript Rails 3.

+4

All Articles