Module: LinkBlock::ViewHelpers

Defined in:
lib/link_block/view_helpers.rb

Defined Under Namespace

Classes: LinkBlockBuilder

Instance Method Summary collapse

Instance Method Details

Yields:

  • (LinkBlockBuilder.new(self, :url_options => url_options, :html_options => html_options))


40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/link_block/view_helpers.rb', line 40

def link_block(*args, &block)
  url_options = args.first
  html_options = args.second || {}

  if html_options and html_options.class != Hash
    raise 'link_block requires html_options to be a Hash'
  end

  if url_options.class != Hash and url_options.class != String
    raise 'link_block requires url_options to be Hash or String -- and for your sake it really should be a Hash :-)'
  end

  yield LinkBlockBuilder.new(self, :url_options => url_options, :html_options => html_options)
end