Module: ErpApp::Extensions::Railties::ActionView::Helpers::TagHelper

Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
Defined in:
lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#form_remote_tag(url, options = {}, &block) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb', line 18

def form_remote_tag(url, options={}, &block)
  #add ajax_replace class
  options[:class].nil? ? 'ajax_replace' : "#{options[:class]} ajax_replace"
  #add remote => true to options
  options.merge!({:remote => true})

  if block_given?
    form_tag url, options do
      yield
    end
  else
    form_tag url, options
  end
end


10
11
12
13
14
15
16
# File 'lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb', line 10

def link_to_remote(name, url, options={})
  #add ajax_replace class
  options[:class].nil? ? 'ajax_replace' : "#{options[:class]} ajax_replace"
  #add remote => true to options
  options.merge!({:remote => true})
  link_to name, url, options
end