Module: Ksk::Navigation
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/actives/navigation.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#get_link(x = '') ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/actives/navigation.rb', line 40 def get_link(x = '') a = '/'+slug+x if parent a = parent.get_link(a) end a end |
#set_link ⇒ Object
36 37 38 |
# File 'lib/actives/navigation.rb', line 36 def set_link write_attribute(:link, get_link) end |
#set_slug ⇒ Object
27 28 29 30 |
# File 'lib/actives/navigation.rb', line 27 def set_slug return if !slug.blank? write_attribute(:slug, title.to_url) end |
#static_setter ⇒ Object
32 33 34 |
# File 'lib/actives/navigation.rb', line 32 def static_setter write_attribute(:static_id, (self.static && self.static.id) || ::Static.all.first.id) end |