Module: Zena::Use::NestedAttributesAlias::ViewMethods

Defined in:
lib/zena/use/nested_attributes_alias.rb

Overview

Lets you use nested_attributes_alias methods in forms: <%= text_field ‘title’ %>

Defined Under Namespace

Classes: InstanceTag

Instance Method Summary collapse

Instance Method Details

#check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object



53
54
55
# File 'lib/zena/use/nested_attributes_alias.rb', line 53

def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_check_box_tag(options, checked_value, unchecked_value)
end

#file_field(object_name, method, options = {}) ⇒ Object



45
46
47
# File 'lib/zena/use/nested_attributes_alias.rb', line 45

def file_field(object_name, method, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("file", options)
end

#hidden_field(object_name, method, options = {}) ⇒ Object



41
42
43
# File 'lib/zena/use/nested_attributes_alias.rb', line 41

def hidden_field(object_name, method, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("hidden", options)
end

#password_field(object_name, method, options = {}) ⇒ Object



37
38
39
# File 'lib/zena/use/nested_attributes_alias.rb', line 37

def password_field(object_name, method, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("password", options)
end

#radio_button(object_name, method, tag_value, options = {}) ⇒ Object



57
58
59
# File 'lib/zena/use/nested_attributes_alias.rb', line 57

def radio_button(object_name, method, tag_value, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_radio_button_tag(tag_value, options)
end

#text_area(object_name, method, options = {}) ⇒ Object



49
50
51
# File 'lib/zena/use/nested_attributes_alias.rb', line 49

def text_area(object_name, method, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_text_area_tag(options)
end

#text_field(object_name, method, options = {}) ⇒ Object



33
34
35
# File 'lib/zena/use/nested_attributes_alias.rb', line 33

def text_field(object_name, method, options = {})
  ViewMethods::InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("text", options)
end