Module: FriendlyId::Slugged::Configuration
- Defined in:
- lib/friendly_id/slugged.rb
Overview
This module adds the :slug_column
, and :sequence_separator
, and :slug_generator_class
configuration options to FriendlyId::Configuration.
Instance Attribute Summary collapse
-
#sequence_separator ⇒ Object
The string used to separate a slug base from a numeric sequence.
-
#slug_column ⇒ Object
The column that will be used to store the generated slug.
-
#slug_generator_class ⇒ Object
Returns the value of attribute slug_generator_class.
Instance Method Summary collapse
-
#query_field ⇒ Object
Makes FriendlyId use the slug column for querying.
Instance Attribute Details
#sequence_separator ⇒ Object
The string used to separate a slug base from a numeric sequence.
By default, --
is used to separate the slug from the sequence. FriendlyId uses two dashes to distinguish sequences from slugs with numbers in their name.
You can change the default separator by setting the sequence_separator configuration option.
For obvious reasons, you should avoid setting it to “-
” unless you’re sure you will never want to have a friendly id with a number in it.
319 320 321 |
# File 'lib/friendly_id/slugged.rb', line 319 def sequence_separator @sequence_separator or defaults[:sequence_separator] end |
#slug_column ⇒ Object
The column that will be used to store the generated slug.
324 325 326 |
# File 'lib/friendly_id/slugged.rb', line 324 def slug_column @slug_column or defaults[:slug_column] end |
#slug_generator_class ⇒ Object
Returns the value of attribute slug_generator_class.
298 299 300 |
# File 'lib/friendly_id/slugged.rb', line 298 def slug_generator_class @slug_generator_class end |
Instance Method Details
#query_field ⇒ Object
Makes FriendlyId use the slug column for querying.
302 303 304 |
# File 'lib/friendly_id/slugged.rb', line 302 def query_field slug_column end |