Class: AlOptions
- Inherits:
-
AlSelector
- Object
- AlWidget
- AlSelector
- AlOptions
- Defined in:
- lib/al_form.rb
Overview
セレクトオプションウィジェット(プルダウンメニュー)
Instance Method Summary (collapse)
-
- (String) make_tag(arg = {})
(AlOptions) 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 = {})
(AlOptions) HTMLタグの生成
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 |
# File 'lib/al_form.rb', line 1142 def make_tag( arg = {} ) return super( arg ) if @hidden r = %Q(<select name="#{@name}" id="#{@name}") (@tag_attr.merge arg).each do |k,v| r << %Q( #{k}="#{Alone::escape_html(v)}") end r << ">\n" @options.each do |k,v| selected = (@value && @value.to_s == k.to_s) ? " selected": "" tagvalue = Alone::escape_html( k.to_s ) r << %Q(<option id="#{name}_#{tagvalue}" value="#{tagvalue}"#{selected}>#{Alone::escape_html(v)}</option>\n) end return r + "</select>\n" end |