I\'m trying to get a selection from a dropdown to populate a table in the same page, using AJAX so that changes appear without a page refresh. I\'ve got as far as working ou
Assume you're using jquery
<%= collection_select :project, :id, Project.all, :id, :name, {}, {:onchange => '$.get("/populate_projects")'} %>
then in your controller
def populate_projects
@project = Project.find(params[:id])
respond_to do |format|
...
format.js { render 'populate_projects', :formats => [:js] }
...
end
end
finally, create populate_projects.js.erb and write any change table content script. @project is available in that script.