Module: PolepinHelper
- Defined in:
- app/helpers/polepin_helper.rb
Instance Method Summary collapse
- #belongs_to_associations(record_class) ⇒ Object
- #collection_name(association) ⇒ Object
- #has_many_associations(record_class) ⇒ Object
- #link_to_collection(record, association) ⇒ Object
- #link_to_record(record) ⇒ Object
- #record_name(record) ⇒ Object
- #timestamp_columns(model_class) ⇒ Object
Instance Method Details
#belongs_to_associations(record_class) ⇒ Object
23 24 25 |
# File 'app/helpers/polepin_helper.rb', line 23 def belongs_to_associations(record_class) Polepin::Utility.class_belongs_to_associations(record_class) end |
#collection_name(association) ⇒ Object
11 12 13 |
# File 'app/helpers/polepin_helper.rb', line 11 def collection_name(association) association.name.to_s.humanize end |
#has_many_associations(record_class) ⇒ Object
27 28 29 |
# File 'app/helpers/polepin_helper.rb', line 27 def has_many_associations(record_class) Polepin::Utility.class_has_many_associations(record_class) end |
#link_to_collection(record, association) ⇒ Object
19 20 21 |
# File 'app/helpers/polepin_helper.rb', line 19 def link_to_collection(record, association) link_to collection_name(association), send("#{association.name}_polepin_#{record.class.table_name.singularize}_url", record.id) end |
#link_to_record(record) ⇒ Object
15 16 17 |
# File 'app/helpers/polepin_helper.rb', line 15 def link_to_record(record) link_to record_name(record), send("polepin_#{record.class.table_name.singularize}_url", record.id) end |
#record_name(record) ⇒ Object
7 8 9 |
# File 'app/helpers/polepin_helper.rb', line 7 def record_name(record) Polepin::Utility.record_name(record) end |