Module: LinkHelper
- Defined in:
- app/helpers/link_helper.rb
Instance Method Summary collapse
- #link_for(object, params = {}) ⇒ Object
- #link_to_object(object, name, html_options = nil, &block) ⇒ Object
Instance Method Details
#link_for(object, params = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/link_helper.rb', line 6 def link_for(object, params = {}) case object when Iqvoc::Concept.base_class concept_url(object, params) when Iqvoc::Collection.base_class collection_url(object, params) when Label::Base label_url(object, params) else raise 'Unsupported object type' end end |
#link_to_object(object, name, html_options = nil, &block) ⇒ Object
2 3 4 |
# File 'app/helpers/link_helper.rb', line 2 def link_to_object(object, name, = nil, &block) link_to name, link_for(object), , &block end |