RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: devpopol
Site: http://www.stephenpaul.me
for a quick&dirty support on jsonp with this, you can go with an after_filter:
after_filter do |controller| if controller.params[:callback] && controller.params[:format].to_s == 'json' controller.response['Content-Type'] = 'application/javascript' controller.response.body = "%s(%s)" % [controller.params[:callback], controller.response.body] end end
from the last time i've seen it, RABL is good with objects that are ActiveModel compliant. doesn't provide a lot of support if for example you have an Array/Hash object that you got from redis that needs to be represented as json.
for a quick&dirty support on jsonp with this, you can go with an after_filter:
from the last time i've seen it, RABL is good with objects that are ActiveModel compliant. doesn't provide a lot of support if for example you have an Array/Hash object that you got from redis that needs to be represented as json.