Class: Webrat::HiddenField

Inherits:
Field show all
Defined in:
lib/webrat/core/elements/field.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Field

#value

Attributes inherited from Element

#element

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Field

#disabled?, field_class, field_classes, #id, inherited, #initialize, #label_text, load, #raise_error_if_disabled, #set, #unset, xpath_search_excluding_hidden

Methods inherited from Element

#initialize, #inspect, load, load_all, #path

Constructor Details

This class inherits a constructor from Webrat::Field

Class Method Details

.xpath_searchObject


200
201
202
# File 'lib/webrat/core/elements/field.rb', line 200

def self.xpath_search
  ".//input[@type = 'hidden']"
end

Instance Method Details

#to_query_stringObject


204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/webrat/core/elements/field.rb', line 204

def to_query_string
  if collection_name?
    super
  else
    checkbox_with_same_name = form.field_named(name, CheckboxField)

    if checkbox_with_same_name.to_query_string.blank?
      super
    else
      nil
    end
  end
end