Class: ApplicationComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/application_component.rb

Instance Method Summary collapse

Instance Method Details

#identifierObject



4
5
6
7
8
9
10
11
12
# File 'app/components/application_component.rb', line 4

def identifier
  klass = self.class

  klass.name
    .tableize
    .singularize
    .gsub("/", "--")
    .gsub("_", "-")
end

#sanitize(string) ⇒ Object



14
15
16
17
18
# File 'app/components/application_component.rb', line 14

def sanitize(string)
  string
    .strip
    .gsub(/\s{2,}|\n/, " ")
end