I use rails with jQuery. a scenario like that
def method_1
respond_to |format|
format.html {}
format.json {return the calculate value}
end
the method recieve a couple of different params, and calculate different value. so when user browser method_1/1 and jQuery code in method_1 view can receive the format.json value, when user browser method_1/2 and jQuery code in method_1 view can receive the format.json value.
how to?