Class: Docent::Link
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Docent::Link
- Defined in:
- app/models/docent/link.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.link_for(controller = nil, action = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/docent/link.rb', line 9 def self.link_for(controller=nil, action=nil) if link = self.where(controller: controller). where(action: action). first link.url elsif link = self.where(controller: controller).first link.url else Docent.default_link end end |
Instance Method Details
#shortcut ⇒ Object
5 6 7 |
# File 'app/models/docent/link.rb', line 5 def shortcut "#{controller}##{action}" end |