Module: HasPermalink::InstanceMethods
- Includes:
- FriendlyUrl
- Defined in:
- lib/has_permalink.rb
Instance Method Summary collapse
-
#generate_permalink ⇒ Object
Generate permalink for the instance if the permalink is empty or nil.
-
#generate_permalink! ⇒ Object
Generate permalink for the instance and overwrite any existing value.
-
#to_param ⇒ Object
Override to send permalink as params.
Methods included from FriendlyUrl
Instance Method Details
#generate_permalink ⇒ Object
Generate permalink for the instance if the permalink is empty or nil.
37 38 39 |
# File 'lib/has_permalink.rb', line 37 def generate_permalink self.permalink = fix_duplication(normalize(self.send(generate_from))) if permalink.blank? end |
#generate_permalink! ⇒ Object
Generate permalink for the instance and overwrite any existing value.
42 43 44 |
# File 'lib/has_permalink.rb', line 42 def generate_permalink! self.permalink = fix_duplication(normalize(self.send(generate_from))) end |
#to_param ⇒ Object
Override to send permalink as params
47 48 49 |
# File 'lib/has_permalink.rb', line 47 def to_param permalink end |