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
-
#link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt link_to method to handle Ajax queries automatically.
Instance Method Details
#link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Adapt link_to method to handle Ajax queries automatically
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rails-ajax/url_helper.rb', line 12 def link_to(name = nil, = nil, = nil, &block) , = name, if block_given? ||= {} if (RailsAjax.config.Enabled and RailsAjax::rails_ajaxifiable?()) .merge!({ :remote => true, :'data-rails-ajax-remote' => true }) end if block_given? return super(, ) do block.call end else return super(name, , ) end end |