Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created April 24, 2011 18:56
Show Gist options
  • Select an option

  • Save jashkenas/939797 to your computer and use it in GitHub Desktop.

Select an option

Save jashkenas/939797 to your computer and use it in GitHub Desktop.
# If the request is asking for JSONP (eg. has a 'callback' parameter), then
# short-circuit, and return the rendered JSONP.
def jsonp_request?
return false unless params[:callback]
@callback = params[:callback]
render :partial => 'common/jsonp.js', :type => :js
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment