Module: RailsAjax::UrlHelper
- Included in:
- ActionView::Base
- Defined in:
- lib/rails-ajax/url_helper.rb
Overview
Module defining methods to include in ActionView::Helpers::FormHelper
Instance Method Summary collapse
-
#button_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt button_to method to handle Ajax queries automatically.
-
#link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt link_to method to handle Ajax queries automatically.
Instance Method Details
#button_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt button_to method to handle Ajax queries automatically
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rails-ajax/url_helper.rb', line 19 def (name = nil, = nil, = nil, &block) , = , name if block_given? ||= {} .merge!({ :remote => true, :form => {:'data-rails-ajax-remote' => true} }) if (RailsAjax.config.enabled? and RailsAjax.rails_ajaxifiable?()) if block_given? return super(, , &block) else return super(name, , ) end end |
#link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt link_to method to handle Ajax queries automatically
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rails-ajax/url_helper.rb', line 7 def link_to(name = nil, = nil, = nil, &block) , = name, if block_given? ||= {} .merge!({ :remote => true, :'data-rails-ajax-remote' => true }) if (RailsAjax.config.enabled? and RailsAjax.rails_ajaxifiable?()) if block_given? return super(, , &block) else return super(name, , ) end end |