Sha256: 599b946fb90cd286422563d420f5a19b4a8d5827173f6c8146e9143a4d885cd1

Contents?: true

Size: 811 Bytes

Versions: 3

Compression:

Stored size: 811 Bytes

Contents

module MasterView
  module Directives

    # create radio_button helper, quoting object and method if necessary
    # merging in any html options specified
    class Radio_button < MasterView::DirectiveBase
      def stag(dcs)
        #eat
      end

      def etag(dcs)
        args = parse_attr_value
        obj = args[0]
        method = args[1]
        tag_value = args[2]

        obj = quote_if(obj)
        method = quote_if(method)

        options = {}
        options.merge! common_html_options(attrs_lck)
        remove_strings_from_attr_value!
        merge_hash_attr_value!(0, options)

        a = []
        a << 'radio_button '+ obj
        a << method
        a << tag_value
        a << attr_value unless attr_value.strip.empty?
        erb_content(a.join(', '))
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
masterview-0.2.3 lib/masterview/directives/radio_button.rb
masterview-0.2.4 lib/masterview/directives/radio_button.rb
masterview-0.2.5 lib/masterview/directives/radio_button.rb