Sha256: 2295cd491eb465b8c43f62048cd04a3888e32eae21e719761390f3768251e9ad

Contents?: true

Size: 1.76 KB

Versions: 10

Compression:

Stored size: 1.76 KB

Contents

module Mack
  module ViewHelpers
    module HtmlHelpers
      
      # This is just an alias to Mack::Utils::Html.
      # 
      # Examples:
      #   <%= link_to("http://www.mackframework.com") %> # => <a href="http://www.mackframework.com">http://www.mackframework.com</a>
      #   <%= link_to("Mack", "http://www.mackframework.com") %> # => <a href="http://www.mackframework.com">Mack</a>
      #   <%= link_to("Mack", "http://www.mackframework.com", :target => "_blank") %> # => <a href="http://www.mackframework.com" target="_blank">Mack</a>
      #   <%= link_to("Mack", "http://www.mackframework.com", :target => "_blank", :rel => :nofollow) %> # => <a href="http://www.mackframework.com" target="_blank" rel="nofollow">Mack</a>
      # If you pass in :method as an option it will be a JavaScript form that will post to the specified link with the 
      # methd specified.
      #   <%= link_to("Mack", "http://www.mackframework.com", :method => :delete) %>
      # If you use the :method option you can also pass in a :confirm option. The :confirm option will generate a 
      # javascript confirmation window. If 'OK' is selected the the form will submit. If 'cancel' is selected, then
      # nothing will happen. This is extremely useful for 'delete' type of links.
      #   <%= link_to("Mack", "http://www.mackframework.com", :method => :delete, :confirm => "Are you sure?") %>
      def link_to(link_text, url = link_text, html_options = {})
        Mack::Utils::Html.href(link_text, url, html_options)
      end
      
      # A wrapper method for views that calls out to Mack::Utils::Html.
      # 
      # Examples:
      #   <%= html.b("hello") %> # => <b>hello</b>
      def html
        Mack::Utils::Html
      end
      
    end # HtmlHelpers
  end # ViewHelpers
end # Mack

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mack-0.0.3 sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.6.1 sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.6.2 sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.4 sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.5 sea_level/helpers/view_helpers/html_helpers.rb
mack-0.2.0 lib/sea_level/helpers/view_helpers/html_helpers.rb
mack-0.2.0.1 lib/sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.7.0 lib/sea_level/helpers/view_helpers/html_helpers.rb
mack-0.1.0 lib/sea_level/helpers/view_helpers/html_helpers.rb
mack-0.0.6 sea_level/helpers/view_helpers/html_helpers.rb