Sha256: f3b56e165a51fe0e77b49d69b60c63a1298fb5aa080b65e7e08d42c383412e19
Contents?: true
Size: 1.7 KB
Versions: 63
Compression:
Stored size: 1.7 KB
Contents
class TableSettings class Action attr_accessor :action_hash, :name def initialize(table_settings) @table_settings = table_settings @action_hash = {} add_defaults end def label(label) @action_hash[:name] = label self end def title(title) @action_hash[:title] = title self end def add_defaults @action_hash[:symlink_remote] = true self end def controller(name) @action_hash[:symlink_controller] = name self end def action(name) @action_hash[:symlink_action] = name self end def outer_controller(name) @action_hash[:symlink_outer_controller] = name self end def outer_id(name) @action_hash[:symlink_outer_id] = name self end def remote(bool) @action_hash[:symlink_remote] = bool self end # @param [Symbol|String] - :get|:put|:post|:delete def http_method(name) @action_hash[:method] = name self end def css_class(name) @action_hash[:class] = name self end def confirm(text) @action_hash[:confirm] = text self end def onclick(text) @action_hash[:js_code] = text self end def css_class_type(type) css=case type when :show then "btn btn-success" when :edit then "btn btn-warning" when :delete then "btn btn-danger" when :destroy then "btn btn-danger" else "btn" end @action_hash[:class] = css self end ## # Position of button # @param [Symbol] pos - :left | :right def position(pos) @action_hash[:position] = pos self end end end
Version data entries
63 entries across 63 versions & 1 rubygems