Sha256: 5e3bd7547a523f78a8bf05313652613590ea07d65af86815261dd4c7942ab9d1
Contents?: true
Size: 685 Bytes
Versions: 12
Compression:
Stored size: 685 Bytes
Contents
module Alchemy module Ingredients class LinkView < BaseView attr_reader :link_text # @param ingredient [Alchemy::Ingredient] # @param text [String] The link text. If not given, the ingredient's text setting or the value will be used. # @param html_options [Hash] Options that will be passed to the a tag. def initialize(ingredient, text: nil, html_options: {}) super(ingredient, html_options: html_options) @link_text = settings_value(:text, value: text, default: value) end def call link_to(link_text, value, {target: ingredient.link_target.presence}.merge(html_options)).html_safe end end end end
Version data entries
12 entries across 12 versions & 1 rubygems