Module: Confirmable::ConfirmsHelper
- Defined in:
- app/helpers/confirmable/confirms_helper.rb
Instance Method Summary collapse
- #confirm_form_tag(&block) ⇒ Object
- #confirm_link_to(name, url_options, html_options = {}) ⇒ Object
- #confirm_url ⇒ Object
Instance Method Details
#confirm_form_tag(&block) ⇒ Object
15 16 17 18 |
# File 'app/helpers/confirmable/confirms_helper.rb', line 15 def confirm_form_tag(&block) raise ArgumentError, "Missing block" unless block_given? form_tag("/"+params[:target_url], :method => params[:method].try(:to_sym), &block) end |
#confirm_link_to(name, url_options, html_options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/confirmable/confirms_helper.rb', line 3 def confirm_link_to(name, , ={}) @method = .delete(:method) { |opt| 'post' } @confirm = .delete(:confirm) #TODO: do something with the return value @target_url = url_for().slice(1..-1) link_to(name, confirm_url, ) end |
#confirm_url ⇒ Object
11 12 13 |
# File 'app/helpers/confirmable/confirms_helper.rb', line 11 def confirm_url confirmable.confirm_url(target_url: @target_url, method: @method) end |