Class: LinkWidget

Inherits:
Cuca::Widget show all
Includes:
Cuca::Generator::Markaby
Defined in:
lib/cuca/stdlib/link.rb

Overview

WARNING: This is a very slow way of creating a link. Better to use

SLinkWidget if you call this many times per page!

Example:

mab { Link('http://cuca.rubyforge.org') { b { "Click here" } }

Instance Method Summary collapse

Methods included from Cuca::Generator::Markaby

#mab, #mabtext

Methods inherited from Cuca::Widget

#app, #cgi, #clear, clear_hints, #content, #content=, #controller, define_attr_method, #escape, #escapeHTML, #get_assigns, #hints, #initialize, #log, #params, #query_parameters, #request_method, #request_parameters, run_attr_method, #session, #to_s, #unescape, #unescapeHTML

Constructor Details

This class inherits a constructor from Cuca::Widget

Instance Method Details

#output(target, params = {}, tag_attrib = {}, &block) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/cuca/stdlib/link.rb', line 36

def output(target, params = {}, tag_attrib = {}, &block) 
  @attribs = tag_attrib
  @attribs[:href] = build_href(target, params) 
  @block = block
  mab {
       a(@attribs)  { text capture(&block) }
  }
end