Sha256: 4b63d6230be0b4b3a7addeac5f0e890932c491d449a1210a4c01fd6f69d29bdd

Contents?: true

Size: 1.18 KB

Versions: 15

Compression:

Stored size: 1.18 KB

Contents

module ErpApp
  module Extensions
    module Railties
      module ActionView
        module Helpers
          module TagHelper
            include ::ActionView::Helpers::UrlHelper
            include ::ActionView::Helpers::TagHelper

            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

            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

          end #TagHelper
        end #Helpers
      end #ActionView
    end #Railties
  end #Extensions
end #ErpApp

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
erp_app-4.0.0 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.16 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.15 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.14 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.13 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.12 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.11 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.10 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.9 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.8 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.7 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.6 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.5 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.4 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb
erp_app-3.1.3 lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb