Sha256: 6dc59d6fe29a9c5bf9fc0ef73bcd19db53bd12560e212f394089eee4311b18ef

Contents?: true

Size: 560 Bytes

Versions: 62

Compression:

Stored size: 560 Bytes

Contents

module ActionView
  module Helpers
    module ConditionalUrlHelper
      def link_to_if_with_block(condition, link, html_options = {}, &block)
        if condition
          link_to link, html_options, &block
        else
          capture &block
        end
      end

      def link_to_unless_with_block(condition, link, html_options = {}, &block)
        unless condition
          link_to link, html_options, &block
        else
          capture &block
        end
      end
    end
  end

  ActionView::Helpers.include(Helpers::ConditionalUrlHelper)
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.45 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.44 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.43 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.42 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.41 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.40 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.39 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.38 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb
workarea-core-3.4.37 lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb