Sha256: a82e0dbed5e87977f7784b765764209ab226dd6fff927e2b13e8fff4a46f3116
Contents?: true
Size: 924 Bytes
Versions: 23
Compression:
Stored size: 924 Bytes
Contents
module ViewMixins module Table def table_for(settings) #settings render :partial => '/helpers/build_table', :layout => false, :locals => {:settings => settings} end ## # Selected values from custom filter, it checks params and session ## def selected_values(form_id, path, default = []) par = params path.each do |p| break if par.blank? unless par[p.to_s].blank? par = par[p.to_s] else par = nil end end selected = par unless par.blank? if selected.blank? par = session[form_id+"_params"] path.each do |p| break if par.blank? unless par[p.to_s].blank? par = par[p.to_s] else par = nil end end selected = par end selected = selected.blank? ? default : selected selected end end end
Version data entries
23 entries across 23 versions & 1 rubygems