adding some ajax to rails app using jquery -


I have a simple drop-down box on a page with the code below:

 < Code> & lt; P & gt; & Lt;% = f.label "Group"% & gt; & Lt; Br / & gt; Select & lt;% = ("Employee", "Group_ID", group.Collect {| p | [p.name, p.id]}, {: include_blank => true})% & gt; & Lt; / P & gt; & Lt; Div id = "employee" & gt; & Lt ;! - This will be filled with AJAX request - & gt; & Lt; / Div & gt;  

This shows the group to the user. What do I want is a division next to this drop down, which shows the number of employees related to a group. I get this number:

  Groups.employees.count  

But I do not know how this will work with Ajax like drop down changes To get this number you have to go back to the server and then update the div.

If I need to, I can use jQuery, possibly: write all the groups with all the counts in the HTML or Javascript variable, and to control the use of JavaScript only to appear at any one time For me


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -