Module: SharedHelper

Defined in:
lib/awesome_form_attributes/shared_helper.rb

Instance Method Summary collapse

Instance Method Details

#collectionsObject



15
16
17
# File 'lib/awesome_form_attributes/shared_helper.rb', line 15

def collections
  instance_variable_get("@#{controller_name}")
end

#collections=(objs) ⇒ Object



23
24
25
# File 'lib/awesome_form_attributes/shared_helper.rb', line 23

def collections=(objs)
  instance_variable_set("@#{controller_name}", objs)
end

#klassObject



3
4
5
# File 'lib/awesome_form_attributes/shared_helper.rb', line 3

def klass
  controller_name.classify.constantize
end

#obj_strObject



7
8
9
# File 'lib/awesome_form_attributes/shared_helper.rb', line 7

def obj_str
  controller_name.singularize
end

#single_objObject



11
12
13
# File 'lib/awesome_form_attributes/shared_helper.rb', line 11

def single_obj
  instance_variable_get("@#{obj_str}")
end

#single_obj=(obj) ⇒ Object



19
20
21
# File 'lib/awesome_form_attributes/shared_helper.rb', line 19

def single_obj=(obj)
  instance_variable_set("@#{obj_str}", obj)
end