Class: AlTextArea
Overview
テキストエリアウィジェット
Instance Method Summary (collapse)
-
- (AlTextArea) initialize(name, arg = {})
constructor
(AlTextArea) constractor.
-
- (String) make_tag(arg = {})
(AlTextArea) HTMLタグの生成.
-
- (String) make_value(*arg)
(AlTextArea) HTML値の生成.
Methods inherited from AlText
Methods inherited from AlWidget
Constructor Details
- (AlTextArea) initialize(name, arg = {})
(AlTextArea) constractor
825 826 827 828 829 830 831 832 |
# File 'lib/al_form.rb', line 825 def initialize( name, arg = {} ) super( name, arg ) @validator = arg[:validator] || /[^\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/ # html必須属性(rows, cols)のセット @tag_attr[:rows] = arg[:rows] || 3 @tag_attr[:cols] = arg[:cols] || 40 end |
Instance Method Details
- (String) make_tag(arg = {})
(AlTextArea) HTMLタグの生成
841 842 843 844 845 846 847 848 849 |
# File 'lib/al_form.rb', line 841 def make_tag( arg = {} ) return super( arg ) if @hidden r = %Q(<textarea name="#{@name}" id="#{@name}") (@tag_attr.merge arg).each do |k,v| r << %Q( #{k}="#{Alone::escape_html(v)}") end return r + ">#{Alone::escape_html( @value )}</textarea>\n" end |
- (String) make_value(*arg)
Note:
改行を
タグに変換しながら出力する。
(AlTextArea) HTML値の生成
860 861 862 |
# File 'lib/al_form.rb', line 860 def make_value( *arg ) return Alone::escape_html_br( arg.empty? ? @value: arg[0] ) end |