a

a(href = "")
Instance Public methods

Generate an Anchor element as a string.

href can either be a string, giving the URL for the HREF attribute, or it can be a hash of the element's attributes.

The body of the element is the string returned by the no-argument block passed in.

1
2
3
4
5
a("http://www.example.com") { "Example" }
  # => "<A HREF=\"http://www.example.com\">Example</A>"
 
a("HREF" => "http://www.example.com", "TARGET" => "_top") { "Example" }
  # => "<A HREF=\"http://www.example.com\" TARGET=\"_top\">Example</A>"
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.