Class: AlRadios
- Inherits:
-
AlSelector
- Object
- AlWidget
- AlSelector
- AlRadios
- Defined in:
- lib/al_form.rb
Overview
ラジオボタンウィジェット
Instance Attribute Summary
Attributes inherited from AlSelector
Attributes inherited from AlWidget
#filter, #foreign, #hidden, #label, #message, #name, #required, #tag_attr, #tag_type, #value
Instance Method Summary collapse
-
#make_tag(appendix_tag = {}) ⇒ String
(AlRadios) htmlタグの生成.
Methods inherited from AlSelector
#initialize, #make_value, #set_value, #validate
Methods inherited from AlWidget
#initialize, #make_value, #set_attr, #set_value
Constructor Details
This class inherits a constructor from AlSelector
Instance Method Details
#make_tag(appendix_tag = {}) ⇒ String
(AlRadios) htmlタグの生成
1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 |
# File 'lib/al_form.rb', line 1217 def make_tag( appendix_tag = {} ) return super( appendix_tag ) if @hidden r = "" @options.each do |k,v| checked = (@value && @value.to_s == k.to_s) ? " checked" : "" tagvalue = Alone::escape_html( k.to_s ) r << %Q(<label><input type="radio" name="#{@name}" id="#{@name}_#{tagvalue}" value="#{tagvalue}"#{checked}) make_tag_attr(r, appendix_tag) r << ">#{Alone::escape_html(v)}</label>#{@separator}\n" end return r end |