Module: SnFoil::Rails::InjectId

Extended by:
ActiveSupport::Concern
Defined in:
lib/snfoil/rails/concerns/inject_id.rb

Instance Method Summary collapse

Instance Method Details

#inject_id(**options) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/snfoil/rails/concerns/inject_id.rb', line 24

def inject_id(**options)
  return options if options[:id]

  options[:id] = id if defined? id
  options[:id] ||= options[:params][:id]
  options
end