Module: Iron::ContentType::WebPublishable

Extended by:
ActiveSupport::Concern
Included in:
Iron::ContentType
Defined in:
app/models/iron/content_type/web_publishable.rb

Instance Method Summary collapse

Instance Method Details

#index_entryObject



27
28
29
# File 'app/models/iron/content_type/web_publishable.rb', line 27

def index_entry
  entries.find_by(route: "")
end

#path_for(entry) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'app/models/iron/content_type/web_publishable.rb', line 17

def path_for(entry)
  return nil unless web_publishing_enabled?

  path_parts = []
  path_parts << base_path if base_path.present?
  path_parts << entry.route

  "/" + path_parts.compact.join("/")
end