Sha256: b6859e01916a85f8b604c398fb675051a8197f7ecc2d4c9ba01413537c994c5d
Contents?: true
Size: 1.48 KB
Versions: 53
Compression:
Stored size: 1.48 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 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 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
53 entries across 53 versions & 1 rubygems