Skip to content

Instantly share code, notes, and snippets.

@keoghpe
Created November 10, 2015 09:54
Show Gist options
  • Save keoghpe/bcc416f9b64208d63e46 to your computer and use it in GitHub Desktop.
Save keoghpe/bcc416f9b64208d63e46 to your computer and use it in GitHub Desktop.
IE9 Rails JSON Request Fix
before_action :fix_ie_params, only: [:create]
def fix_ie_params
unless params.has_key?(:my_missing_param)
begin
request.body.rewind
params.merge! ActiveSupport::JSON.decode(request.body.read)
rescue Exception=>e
Rails.logger.warn "[#{self.class}] #{e.message}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment