Class: Decidim::Admin::StaticPageForm

Inherits:
Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
app/forms/decidim/admin/static_page_form.rb

Overview

A form object to create or update pages.

Instance Method Summary collapse

Instance Method Details

#control_public_access?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/forms/decidim/admin/static_page_form.rb', line 45

def control_public_access?
  current_organization.force_users_to_authenticate_before_access_organization?
end

#slugObject



28
29
30
# File 'app/forms/decidim/admin/static_page_form.rb', line 28

def slug
  super.to_s.downcase
end

#topicObject



32
33
34
35
36
37
# File 'app/forms/decidim/admin/static_page_form.rb', line 32

def topic
  @topic ||= StaticPageTopic.find_by(
    organization: organization,
    id: topic_id
  )
end

#topicsObject



39
40
41
42
43
# File 'app/forms/decidim/admin/static_page_form.rb', line 39

def topics
  @topics ||= StaticPageTopic.where(
    organization: current_organization
  )
end