Module: ActionView::Helpers::ConditionalUrlHelper

Included in:
ActionView::Helpers
Defined in:
lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
# File 'lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb', line 4

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


12
13
14
15
16
17
18
# File 'lib/workarea/ext/freedom_patches/action_view_conditional_url_helper.rb', line 12

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