Class: AlRadios
- Inherits:
-
AlSelector
- Object
- AlWidget
- AlSelector
- AlRadios
- Defined in:
- lib/al_form.rb
Overview
ラジオボタンウィジェット
Instance Method Summary (collapse)
-
- (String) make_tag(arg = {})
(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
- (String) make_tag(arg = {})
(AlRadios) htmlタグの生成
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 |
# File 'lib/al_form.rb', line 1173 def make_tag( arg = {} ) return super( arg ) 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}) (@tag_attr.merge arg).each do |k,v| r << %Q( #{k}="#{Alone::escape_html(v)}") end r << " #{AL_FORM_EMPTYTAG_CLOSE}#{Alone::escape_html(v)}</label>#{@separator}\n" end return r end |