Class: AlTextArea
Overview
テキストエリアウィジェット
Instance Attribute Summary
Attributes inherited from AlText
Attributes inherited from AlWidget
#filter, #foreign, #hidden, #label, #message, #name, #required, #tag_attr, #tag_type, #value, #value_format
Instance Method Summary collapse
-
#initialize(name, arg = {}) ⇒ AlTextArea
constructor
(AlTextArea) constructor.
-
#make_tag(appendix_tag = {}) ⇒ String
(AlTextArea) HTMLタグの生成.
-
#make_value(*arg) ⇒ String
(AlTextArea) HTML値の生成.
Methods inherited from AlText
Methods inherited from AlWidget
Constructor Details
#initialize(name, arg = {}) ⇒ AlTextArea
(AlTextArea) constructor
883 884 885 886 887 888 889 890 |
# File 'lib/al_form.rb', line 883 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
#make_tag(appendix_tag = {}) ⇒ String
(AlTextArea) HTMLタグの生成
899 900 901 902 903 904 905 906 |
# File 'lib/al_form.rb', line 899 def make_tag( appendix_tag = {} ) return super( appendix_tag ) if @hidden r = %Q(<textarea name="#{@name}" id="#{@name}") make_tag_attr(r, appendix_tag) r << ">#{Alone::escape_html( @value )}</textarea>\n" return r end |
#make_value(*arg) ⇒ String
Note:
改行を
タグに変換しながら出力する。
(AlTextArea) HTML値の生成
916 917 918 |
# File 'lib/al_form.rb', line 916 def make_value( *arg ) return Alone::escape_html_br( arg.empty? ? @value : arg[0] ) end |