lib/ballast/concerns/common.rb in ballast-1.5.0 vs lib/ballast/concerns/common.rb in ballast-1.5.1

- old
+ new

@@ -9,10 +9,10 @@ module Common # Checks if the current request wants JSON or JSONP as response. # # @return [Boolean] `true` if the request is JSON, `false` otherwise. def is_json? - request.format.to_s =~ /^json/ || params[:json].to_boolean ? true : false + ([:json, :jsonp].include?(request.format.to_sym) || params[:json].to_boolean) ? true : false end # Checks if the user is sending any data. # # @return [Boolean] `true` if the user is sending data, `false` otherwise. \ No newline at end of file