Sha256: a6e7d6cc23b614af38077e825ea43a52a599add14cb0033eb1cc392176f60a12
Contents?: true
Size: 1.57 KB
Versions: 43
Compression:
Stored size: 1.57 KB
Contents
module FlexaLib module Helpers module ButtonGridHelpers #BUTTON_GRID_HELPERS def flexa_grid_button_show_to(obj) link_to content_tag("i", "",:class=>"icon-search icon-white"), obj, :class=>"btn btn-smallest btn-info" end #BUTTON_GRID_HELPERS def flexa_grid_button_edit_to(obj) model_name = obj.class.to_s.underscore link_to content_tag("i", "",:class=>"icon-pencil icon-white"), send("edit_#{model_name}_path",obj), :class=>"btn btn-smallest btn-warning" end #BUTTON_GRID_HELPERS def flexa_grid_button_delete_to(obj) link_to content_tag("i", "",:class=>"icon-minus icon-white"), obj, :confirm => 'Are you sure?', :method => :delete, :class=>"btn btn-smallest btn-danger" end #BUTTON_GRID_HELPERS def flexa_grid_button_select_to(obj,fill) afill=fill.split(",") fill = "" afill.each do |f| fill << "window.parent.$('##{f}').attr('value','"+obj.send(f).to_s+"');" end link_to content_tag("i", "",:class=>"icon-ok icon-white"), "#", :class=>"btn btn-smallest btn-success",:onclick=>fill+"window.parent.$('#div_"+afill.first.to_s+"').modal('hide');" #flexa_grid_button_generic("success","ok","#",:onclick=>fill+"window.parent.$('#lookup').modal('hide');") end #BUTTON_GRID_HELPERS def flexa_grid_button_generic(button,icon,path,*args) options = args.extract_options! options[:class]= "btn btn-smallest btn-"+button concat(link_to content_tag("i", "",:class=>"icon-"+icon+" icon-white"), path, options) end end end end
Version data entries
43 entries across 43 versions & 1 rubygems