Sha256: 62af119e7804377462bb47a025b6b12ae3beb6ebc2a604f5cda4c28b3fccd676

Contents?: true

Size: 310 Bytes

Versions: 6

Compression:

Stored size: 310 Bytes

Contents

module Trestle
  module ParamsHelper
    def persistent_params
      flat, nested = Trestle.config.persistent_params.partition { |p| !p.is_a?(Hash) }
      nested = nested.inject({}) { |result, param| result.merge(param) }

      params.slice(*(flat + nested.keys)).permit(*(flat << nested))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trestle-0.10.0 app/helpers/trestle/params_helper.rb
trestle-0.10.0.pre2 app/helpers/trestle/params_helper.rb
trestle-0.10.0.pre app/helpers/trestle/params_helper.rb
trestle-0.9.8 app/helpers/trestle/params_helper.rb
trestle-0.9.7 app/helpers/trestle/params_helper.rb
trestle-0.9.6 app/helpers/trestle/params_helper.rb