Sha256: 01b5d29315e0f2efd3561f9fde29295a6b99e19daac48785f63db66b0e23ed24

Contents?: true

Size: 731 Bytes

Versions: 2

Compression:

Stored size: 731 Bytes

Contents

module Cello
  module Structure
    module SelectHelper
      def define_extras_for_select(name)
        define_method "#{name}_get_options" do
          options = Array.new
          send(name).options.each do |option|
            options.push option.text
          end
          options
        end
        define_method "#{name}_select" do |option|
          send(name).select option
        end
        define_method "#{name}_is" do |option|
          send(name).selected_options.last.text == option
        end
        define_method "#{name}_selected" do
          send(name).selected_options.last.text
        end
      #  define_method "#{name}_clear" do
      #    send(name).clear
      #  end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cello-0.0.17 lib/cello/structure/html_elements/select_helper.rb
cello-0.0.16 lib/cello/structure/html_elements/select_helper.rb