Module: FriendlyId::Slugged
- Defined in:
- lib/friendly_id/disabler.rb
Overview
The Slugged module is an extension of FriendlyId''s functionality, providing a way to customize how object URLs are generated with slugs.
Instance Method Summary collapse
-
#to_param ⇒ String
Overrides the default
to_parammethod to conditionally return the record''s ID when FriendlyId is disabled, otherwise leveraging the slug functionality.
Instance Method Details
#to_param ⇒ String
Overrides the default to_param method to conditionally return the record''s ID
when FriendlyId is disabled, otherwise leveraging the slug functionality.
43 44 45 |
# File 'lib/friendly_id/disabler.rb', line 43 def to_param ::FriendlyId::Disabler.disabled? ? id&.to_s : super end |