Class: Aureus::Components::DataTableRowButton
- Inherits:
-
Renderable
- Object
- Renderable
- Aureus::Components::DataTableRowButton
- Defined in:
- lib/aureus/components/data_table.rb
Instance Method Summary collapse
-
#initialize(type, text, url, options) ⇒ DataTableRowButton
constructor
A new instance of DataTableRowButton.
- #render ⇒ Object
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
#initialize(type, text, url, options) ⇒ DataTableRowButton
Returns a new instance of DataTableRowButton.
138 139 140 141 142 143 |
# File 'lib/aureus/components/data_table.rb', line 138 def initialize type, text, url, init , remote: true, confirm: 'Delete resource?' @type = type @text = text @url = url end |
Instance Method Details
#render ⇒ Object
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/aureus/components/data_table.rb', line 145 def render @text = ' ' unless @type == :text case @type when :text link_to @text, @url when :print link_to @text, @url, class: :print when :show link_to @text, @url, class: :show when :edit link_to @text, @url, class: :edit when :destroy if [:remote] link_to @text, @url, class: :destroy, method: :delete, data: { confirm: [:confirm] } else link_to @text, @url, class: :destroy end end end |