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
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
878 879 880 881 882 883 884 885 |
# File 'lib/al_form.rb', line 878 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タグの生成
894 895 896 897 898 899 900 901 |
# File 'lib/al_form.rb', line 894 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値の生成
911 912 913 |
# File 'lib/al_form.rb', line 911 def make_value( *arg ) return Alone::escape_html_br( arg.empty? ? @value : arg[0] ) end |