Module: ThinMan::AjaxHelper
- Defined in:
- lib/thin_man/ajax_helper.rb
Instance Method Summary collapse
- #ajax_hash(target, method = 'html') ⇒ Object
- #ajax_link(name, options, html_options, target, sub_class = nil, insert_method = nil) ⇒ Object
Instance Method Details
#ajax_hash(target, method = 'html') ⇒ Object
17 18 19 20 21 22 |
# File 'lib/thin_man/ajax_helper.rb', line 17 def ajax_hash(target, method='html') { data: { ajax_form: true, ajax_target: target, insert_method: method } } end |
#ajax_link(name, options, html_options, target, sub_class = nil, insert_method = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/thin_man/ajax_helper.rb', line 3 def ajax_link(name, , , target, sub_class=nil, insert_method=nil) sub_class ||= 'true' insert_method ||= 'html' = { 'data-ajax-link' => true, 'data-ajax-target' => target, 'data-insert-method' => insert_method } .merge!('data-sub-type' => sub_class) if sub_class.present? link_to(name, , .merge()) end |