Question: Prior to Rails 3, I used this code to observe a field dynamically and pass the data in that field to a controller:

```
    <%= observe_field :transaction_borrower_netid,
    :url => { :controller => :live_validations, :action => :validate_borrower_netid },
    :frequency => 0.5,
    :update => :borrower_netid_message,
    :with => "borrower_netid" %>

```

I'm trying to update that code to work with Jquery and Rails 3, but I can't get it to work. I updated my **routes.rb** to include

```
  match "/live_validations/validate_borrower_netid" => "live_validations#validate_borrower_netid", :as => "validate_borrower"

```

and I'm trying to observe the field and make the necessary calls with:

```
    jQuery(function($) {
  // when the #transaction_borrower_netid field changes
  $("#transaction_borrower_netid").change(function() {
    // make a POST call and update the borrower_netid_message with borrower_netid
    $.post(<%= validate_borrower_path %>, this.value, function(html) {
        $("#borrower_netid_message").html(html);
    });
  });
})

```

but it's not working. My Javascript and Jquery skills are severely lacking, so any help anyone could provide would be much appreciated. Thanks!

Answer: 
You can use `mod_rewrite` to rewrite `?id=5,1` to `?id=5&lang=1` internally. 

Otherwise, the value of `id` will be `5,1`. Your application would then need to know that `id` contains more than the `id`. It could then parse out the language from the id. However, this will become confusing when you introduce more parameters.
Two solutions:

Firstly, you could simply reformat the parameters when they arrive in your PHP program. With `?id=5,1`, you'll get a PHP `$_GET` array with `id` `'5,1'`. This you can simply split using the `explode()` function to get the two values you want.

The second solution is to use the Apache `mod_rewrite` feature, to modify the URL arguments before they arrive at PHP. For this, you'll need to understand regular expressions (regex), as mod\_rewrite uses this for it's work. You should google 'mod\_rewrite' and 'regex' to find out more.

However mod\_rewrite is typically used to get rid of GET arguments entirely. For example the URLs of the questions on this site do not have any get arguments, but the server translates the arguments between the slashes into GET arguments. This is considered better practice than simply than changing how the arguments look, as it is more user-friendly and SEO friendly.

Hope that helps.