Module: FlexaLib::Helpers::TableHelpers
- Included in:
- FlexaLib::Helpers
- Defined in:
- lib/flexa_lib/helpers/table_helpers.rb
Instance Method Summary collapse
-
#flexa_table_for(collection, *args, &proc) ⇒ Object
TABLE_HELPERS.
Instance Method Details
#flexa_table_for(collection, *args, &proc) ⇒ Object
TABLE_HELPERS
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/flexa_lib/helpers/table_helpers.rb', line 6 def flexa_table_for(collection, *args, &proc) = args. [:html]={:class=>'table table-striped table-bordered table-condensed'} table_for collection, do |t| if [:actions].present? && [:actions].count > 0 t.column :title=>"",:html => { :th => { :width => (([:actions].count.to_i*21)).to_s }, :td=>{:class=>"btn_actions"}} do |resource| [: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 |