Module: PinFlags::FeatureTagsHelper

Defined in:
app/helpers/pin_flags/feature_tags_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_feature_tag_row_delete_confirmation(feature_tag) ⇒ Object



15
16
17
18
# File 'app/helpers/pin_flags/feature_tags_helper.rb', line 15

def display_feature_tag_row_delete_confirmation(feature_tag)
  sanitized_name = strip_tags(feature_tag.name)
  "Are you sure you want to delete the feature tag '#{sanitized_name}'?"
end

#display_feature_tag_table_turbo_frame_row_id(feature_tag) ⇒ Object



11
12
13
# File 'app/helpers/pin_flags/feature_tags_helper.rb', line 11

def display_feature_tag_table_turbo_frame_row_id(feature_tag)
  "feature_tags_table_row_#{dom_id(feature_tag)}"
end

#pin_flags_logo(width: 260, height: 85) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/pin_flags/feature_tags_helper.rb', line 3

def (width: 260, height: 85)
  file_path = PinFlags::Engine.root.join("docs", "pin_flags_logo.svg")
  svg = File.read(file_path)
  svg = svg.sub(/width="[^"]*"/, %(width="#{width}"))
  svg = svg.sub(/height="[^"]*"/, %(height="#{height}"))
  svg.html_safe
end