feature/share-libs
rb 47 lines 903 Bytes
Raw
1 ActiveAdmin.register Page do
2 menu priority: 8, parent: 'Page'
3 permit_params :page_slug, :page_content, :locale, :title, :category
4
5 index do
6 selectable_column
7 column :page_slug
8 column :title
9 column :page_content do |page|
10 strip_tags page.page_content.truncate 150
11 end
12 column :locale
13 column :category
14 actions
15 end
16
17 filter :page_content
18 filter :title
19 filter :category
20 filter :created_at
21 filter :updated_at
22
23 show do
24 attributes_table do
25 row :page_slug
26 row :title
27 row :category
28 row :page_content do |page|
29 raw page.page_content
30 end
31 row :locale
32 row :created_at
33 row :updated_at
34 end
35 end
36
37 form do |f|
38 f.inputs do
39 f.input :page_slug
40 f.input :title
41 f.input :category
42 f.input :locale
43 f.input :page_content, as: :quill_editor
44 end
45 f.actions
46 end
47 end