Sha256: aa49332c01337d95a34cdecf6208175036a6d22a3c77145403a251fdc0703976

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

module MasterView
  module Directives

    #creates a link_to
    class LinkTo < MasterView::DirectiveBase

      metadata :priority => :default,
        :category => 'link',
        :description => 'Replaces the element using the Rails link_to helper',
        :element_usage => 'a'

      attr_arg :name do |value, args| if value.include?('=>') : args.unshift(value); end; nil; end # if hash push back on, discard name
      attr_arg :options, :default => {}
      attr_arg :html_options, :default => {}, :append_element_attrs => [:common_html]
      attr_arg :params, :varargs => true

      event :element do
        render erb_content('link_to', quote(content_string), :options, :html_options, :params)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
masterview-0.3.1 lib/masterview/directives/link_to.rb
masterview-0.3.0 lib/masterview/directives/link_to.rb
masterview-0.3.2 lib/masterview/directives/link_to.rb
masterview-0.3.3 lib/masterview/directives/link_to.rb
masterview-0.3.4 lib/masterview/directives/link_to.rb