I need to pass json object and format.js from a Rails controller.. if I do
respond_to do |format|
format.js
end
I get the javascript file (controllername.js) to run. If I do
respond_to do |format|
format.js {render json: @thing}
end
I get the json..
Is there a way to get both?