Sha256: 99891299c8864f810386304c9898203425e66cb3f2d9a756c11cbf5daa06143e
Contents?: true
Size: 1.04 KB
Versions: 43
Compression:
Stored size: 1.04 KB
Contents
module FlexaLib module Helpers module TableHelpers #TABLE_HELPERS def flexa_table_for(collection, *args, &proc) options = args.extract_options! options[:html]={:class=>'table table-striped table-bordered table-condensed'} table_for collection, options do |t| if options[:actions].present? && options[:actions].count > 0 t.column :title=>"",:html => { :th => { :width => ((options[:actions].count.to_i*21)).to_s }, :td=>{:class=>"btn_actions"}} do |resource| options[:actions].each do |action| if [:show,:edit,:delete].include? action concat(send("flexa_grid_button_#{action}_to",resource)) elsif [:select].include? action concat(send("flexa_grid_button_select_to",resource,params[:fill])) else send("#{action}",resource) end end end end begin t.instance_eval(&proc) rescue concat("") end end end end end end
Version data entries
43 entries across 43 versions & 1 rubygems