Module: BiovisionComponentsHelper
- Defined in:
- app/helpers/biovision_components_helper.rb
Overview
Helper methods for component handling
Instance Method Summary collapse
- #admin_biovision_component_link(entity, text = nil, options = {}) ⇒ Object
- #component_name(slug) ⇒ Object
Instance Method Details
#admin_biovision_component_link(entity, text = nil, options = {}) ⇒ Object
8 9 10 11 |
# File 'app/helpers/biovision_components_helper.rb', line 8 def admin_biovision_component_link(entity, text = nil, = {}) text ||= component_name(entity.slug) link_to(text, admin_component_path(slug: entity.slug), ) end |
#component_name(slug) ⇒ Object
14 15 16 17 |
# File 'app/helpers/biovision_components_helper.rb', line 14 def component_name(slug) slug = slug.respond_to?(:slug) ? slug.slug : slug t("biovision.components.#{slug}.name", default: slug) end |