Module: PagesCore::Admin::PageJsonHelper
- Included in:
- Admin::PagesController, AdminHelper
- Defined in:
- app/helpers/pages_core/admin/page_json_helper.rb
Instance Method Summary collapse
Instance Method Details
#page_json(page) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/pages_core/admin/page_json_helper.rb', line 6 def page_json(page) { id: page.id, param: page.to_param, name: page.name, parent_page_id: page.parent_page_id, locale: page.locale, status: page.status, news_page: page.news_page, published_at: page.published_at, pinned: page.pinned?, starts_at: page.starts_at, permissions: (page) } end |
#page_permissions(page) ⇒ Object
17 18 19 20 |
# File 'app/helpers/pages_core/admin/page_json_helper.rb', line 17 def (page) [(:edit if policy(page).edit?), (:create if policy(page).edit?)].compact end |