Topic: How to access Jquey's Ajax call in RoR?
Guys I'm really novice to this RoR, and at this moment i reached to complex situation that "how to use Jquery's ajax() call in RoR?"
I've a controller called Projects like this
class ProjectsController < ApplicationController
def stagemilestone
@milestones=Milestone.find_by_sql("SELECT name, created_at FROM milestones WHERE stage=1")
end
endand i want to call this action from jquery's ajax call and return the data, for this I'm using like this
$.ajax({
url: "/projects/stagemilestone",
success: function(){
//here i need the returned data from controller
// means output of @milestones
}
});So please help me, how to do this?
Last edited by Shreekumar (2011-09-20 04:41:20)