Sha256: 57d0a62cbe2d8521fad67abb12a2b974b84f159c776d8a3fd15c25d9425e7dff

Contents?: true

Size: 425 Bytes

Versions: 41

Compression:

Stored size: 425 Bytes

Contents

module Pliny::Helpers
  module Params
    def body_params
      @body_params ||= parse_body_params
    end

    private

    def parse_body_params
      if request.media_type == "application/json"
        p = indifferent_params(MultiJson.decode(request.body.read))
        request.body.rewind
        p
      elsif request.form_data?
        indifferent_params(request.POST)
      else
        {}
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
pliny-0.26.0 lib/pliny/helpers/params.rb
pliny-0.25.1 lib/pliny/helpers/params.rb
pliny-0.25.0 lib/pliny/helpers/params.rb
pliny-0.24.0 lib/pliny/helpers/params.rb
pliny-0.23.0 lib/pliny/helpers/params.rb
pliny-0.22.0 lib/pliny/helpers/params.rb
pliny-0.21.0 lib/pliny/helpers/params.rb
pliny-0.20.2 lib/pliny/helpers/params.rb
pliny-0.20.1 lib/pliny/helpers/params.rb
pliny-0.20.0 lib/pliny/helpers/params.rb
pliny-0.19.0 lib/pliny/helpers/params.rb
pliny-0.18.0 lib/pliny/helpers/params.rb
pliny-0.17.1 lib/pliny/helpers/params.rb
pliny-0.17.0 lib/pliny/helpers/params.rb
pliny-0.16.3 lib/pliny/helpers/params.rb
pliny-0.16.2 lib/pliny/helpers/params.rb
pliny-0.16.1 lib/pliny/helpers/params.rb
pliny-0.16.0 lib/pliny/helpers/params.rb
pliny-0.15.1 lib/pliny/helpers/params.rb
pliny-0.15.0 lib/pliny/helpers/params.rb