Module: Lipsiadmin::View::Helpers::FormHelper

Defined in:
lib/view/helpers/view_helper.rb

Overview

Returns text_area, text_field, password_field with a default extjs css style.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



10
11
12
13
14
# File 'lib/view/helpers/view_helper.rb', line 10

def self.included(base)#:nodoc:
  base.alias_method_chain :text_area, :style
  base.alias_method_chain :text_field, :style
  base.alias_method_chain :password_field, :style
end

Instance Method Details

#password_field_with_style(name, method, options = {}) ⇒ Object

Returns password_field with extjs style alias for password_field, for use the original tag use:

password_field_without_style


43
44
45
46
47
# File 'lib/view/helpers/view_helper.rb', line 43

def password_field_with_style(name, method, options = {})
  options[:class] ||= "x-form-text"
  options[:style] ||= "width:100%"
  password_field_without_style(name, method, options)
end

#text_area_with_style(name, value = nil, options = {}) ⇒ Object

Returns text_area with extjs style alias for text_area, for use the original tag use:

text_area_without_style


21
22
23
24
25
# File 'lib/view/helpers/view_helper.rb', line 21

def text_area_with_style(name, value = nil, options = {})
  options[:class] ||= "x-form-field"
  options[:style] ||= "width:100%;height:80px"
  text_area_without_style(name, value, options)
end

#text_field_with_style(name, method, options = {}) ⇒ Object

Returns text_field with extjs style alias for text_field, for use the original tag use:

text_field_without_style


32
33
34
35
36
# File 'lib/view/helpers/view_helper.rb', line 32

def text_field_with_style(name, method, options = {})
  options[:class] ||= "x-form-text"
  options[:style] ||= "width:100%"
  text_field_without_style(name, method, options)
end