Sha256: 5b7256153c8e59d2d144d5cd81c8dc8522826daba24d3e12c8489f9075529667
Contents?: true
Size: 430 Bytes
Versions: 30
Compression:
Stored size: 430 Bytes
Contents
class InlineComponent < ViewComponent::Base def initialize(model, attribute) @model = model @attribute = attribute @unsuffixed_attribute = unsuffixed(attribute) @frame_id = dom_id(model, "#{attribute}_inline_edit") super end SUFIJOS = %i[f text].freeze def unsuffixed(attribute) ret = attribute.to_s.dup SUFIJOS.each do |sufijo| ret.gsub!(/_#{sufijo}$/, '') end ret end end
Version data entries
30 entries across 30 versions & 1 rubygems