Class: Spree::Pages::Post

Inherits:
Spree::Page show all
Defined in:
app/models/spree/pages/post.rb

Instance Method Summary collapse

Methods inherited from Spree::Page

#create_preview, #custom?, #display_name, #duplicate, #layout_sections?, #linkable?, #preview_url, #promote, #store, #theme

Methods included from Spree::Previewable

#preview?

Instance Method Details

#customizable?Boolean



22
23
24
# File 'app/models/spree/pages/post.rb', line 22

def customizable?
  true
end

#default_sectionsObject



16
17
18
19
20
# File 'app/models/spree/pages/post.rb', line 16

def default_sections
  [
    Spree::PageSections::PostDetails.new,
  ]
end

#icon_nameObject



12
13
14
# File 'app/models/spree/pages/post.rb', line 12

def icon_name
  'article'
end

#page_builder_urlObject



4
5
6
7
8
9
10
# File 'app/models/spree/pages/post.rb', line 4

def page_builder_url
  return unless page_builder_url_exists?(:post_path)

  post = store.posts.published.last || store.posts.last
  return if post.nil?
  Spree::Core::Engine.routes.url_helpers.post_path(post)
end