Passing javascript variable to ruby code

I am trying to implement an flexigrid in ruby on rails…
I am successful in implementing the flexigrid code…
Then i tried to implement a dialog box for “New User” … It worked
fine … When i click on the Add New User the _form.html.erb loads into
the dialog box …
My problem is that when i tried to implement the Edit button in the
flexigrid which should open the edit.html.erb for that particular
user …
I need to pass the id to the ruby code where it opens the edit form in
the dialog box … Please help me guys … I am new to ruby on rails …
Please do not mind if my question is wrong…
I am able to it in the controller but dialog box is not possible…

Please help me guys …

My Code:

index.html.erb

Users

yrkapil wrote in post #1050834:

I am trying to implement an flexigrid in ruby on rails…
I am successful in implementing the flexigrid code…
Then i tried to implement a dialog box for “New User” … It worked
fine … When i click on the Add New User the _form.html.erb loads into
the dialog box …
My problem is that when i tried to implement the Edit button in the
flexigrid which should open the edit.html.erb for that particular
user …
I need to pass the id to the ruby code where it opens the edit form in
the dialog box … Please help me guys … I am new to ruby on rails …
Please do not mind if my question is wrong…
I am able to it in the controller but dialog box is not possible…

Please help me guys …

This first thing you should do is move your JavaScript out of your HTML.
Behavior should be separated from the view, just as styling should be
separated from structure. Rails is best used with Unobtrusive JavaScript
(UJS) and has good support for moving data between the Ruby and
JavaScript worlds.

Ryan B. has created a Railscast that shows a few different options to
accomplish what you need.