Class: Spree::PageLink
- Inherits:
-
Object
- Object
- Spree::PageLink
- Defined in:
- app/models/spree/page_link.rb
Instance Method Summary collapse
Instance Method Details
#formatted_url ⇒ Object
31 32 33 34 35 36 |
# File 'app/models/spree/page_link.rb', line 31 def formatted_url return if url.blank? return url if %w[mailto: tel:].any? { |protocol| url.start_with?(protocol) } @formatted_url ||= url.match(/http:\/\/|https:\/\//) ? url : "http://#{url}" end |
#linkable_url ⇒ Object
27 28 29 |
# File 'app/models/spree/page_link.rb', line 27 def linkable_url @linkable_url ||= linkable&.page_builder_url || formatted_url end |