Class: Aurita::GUI::Reset_Button
- Defined in:
- lib/aurita-gui/button.rb
Overview
Specialization of Aurita::GUI::Element for submit buttons. Set @tag to :input, @type to :reset. Block argument will be used as button label (:value) Example:
b = Reset_Button.new(:class => :css_class) { 'click me' }
Note that reset buttons in forms are considered bad style in terms of usability.
Instance Attribute Summary
Attributes inherited from Element
#attrib, #content, #parent, #tag, #type
Instance Method Summary collapse
-
#initialize(params, &block) ⇒ Reset_Button
constructor
A new instance of Reset_Button.
Methods inherited from Element
#+, #[], #[]=, #clear_floating, #dom_id, #dom_id=, #each, #empty?, #id, #id=, #length, #method_missing, #string, #to_ary
Constructor Details
#initialize(params, &block) ⇒ Reset_Button
Returns a new instance of Reset_Button.
74 75 76 77 78 79 80 81 |
# File 'lib/aurita-gui/button.rb', line 74 def initialize(params, &block) params[:tag] = :input params[:type] = :reset unless params[:type] if block_given? then params[:value] = yield end super(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element