class TableSettings::Button
Attributes
hash[R]
Public Class Methods
new(id, label, url_path)
click to toggle source
# File lib/table_settings/table_button.rb, line 87 def initialize(id, label, url_path) @id = id @hash = {:name => label} remote(true) url(url_path) end
Public Instance Methods
action(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 119 def action(name) @hash[:symlink_action] = name self end
confirm(string)
click to toggle source
# File lib/table_settings/table_button.rb, line 129 def confirm(string) @hash[:confirm] = string self end
controller(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 114 def controller(name) @hash[:symlink_controller] = name self end
css_class(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 134 def css_class(name) @hash[:class] = name self end
css_class_type(type)
click to toggle source
# File lib/table_settings/table_button.rb, line 149 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" when :log then "btn btn-inverse" else "btn" end @hash[:class] = css self end
css_td_class(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 162 def css_td_class(name) @hash[:td_class] = name self end
css_tr_class(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 166 def css_tr_class(name) @hash[:tr_class] = name end
js_code(string)
click to toggle source
javascript code for button onclick
# File lib/table_settings/table_button.rb, line 145 def js_code(string) @hash[:js_code] = string end
js_method(string)
click to toggle source
javascript method for button
# File lib/table_settings/table_button.rb, line 140 def js_method(string) @hash[:js_method] = string end
method(symbol)
click to toggle source
# File lib/table_settings/table_button.rb, line 124 def method(symbol) @hash[:method] = symbol self end
outer_controller(name)
click to toggle source
# File lib/table_settings/table_button.rb, line 104 def outer_controller(name) @hash[:symlink_outer_controller] = name self end
outer_id(id)
click to toggle source
# File lib/table_settings/table_button.rb, line 109 def outer_id(id) @hash[:symlink_outer_id] = id self end
remote(boolean)
click to toggle source
# File lib/table_settings/table_button.rb, line 99 def remote(boolean) @hash[:symlink_remote] = boolean self end
title(string)
click to toggle source
Help Title (for mouseover) of buttons, no title means usage of button name
# File lib/table_settings/table_button.rb, line 171 def title(string) @hash[:title] = string end
url(path)
click to toggle source
# File lib/table_settings/table_button.rb, line 94 def url(path) @hash[:url] = path self end