зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-04 18:55:50 +03:00
Add specs configuration
Этот коммит содержится в:
49
spec/dummy/app/admin/authors.rb
Обычный файл
49
spec/dummy/app/admin/authors.rb
Обычный файл
@@ -0,0 +1,49 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ActiveAdmin.register Author do
|
||||
menu priority: 1
|
||||
|
||||
permit_params :name, :email, :age, :avatar, profile_attributes: %i[id description _destroy]
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
id_column
|
||||
column :name
|
||||
column :email
|
||||
column :created_at
|
||||
actions
|
||||
end
|
||||
|
||||
filter :name
|
||||
filter :created_at
|
||||
|
||||
show do
|
||||
attributes_table do
|
||||
row :name
|
||||
row :email
|
||||
row :age
|
||||
row :avatar do |record|
|
||||
image_tag url_for(record.avatar), style: 'max-width:800px;max-height:500px' if record.avatar.attached?
|
||||
end
|
||||
row :created_at
|
||||
row :updated_at
|
||||
row :profile
|
||||
end
|
||||
active_admin_comments
|
||||
end
|
||||
|
||||
form do |f|
|
||||
f.inputs do
|
||||
f.input :name
|
||||
f.input :email
|
||||
f.input :age
|
||||
f.input :avatar,
|
||||
as: :file,
|
||||
hint: (object.avatar.attached? ? "Current: #{object.avatar.filename}" : nil)
|
||||
end
|
||||
f.has_many :profile, allow_destroy: true do |ff|
|
||||
ff.input :description
|
||||
end
|
||||
f.actions
|
||||
end
|
||||
end
|
||||
32
spec/dummy/app/admin/dashboard.rb
Обычный файл
32
spec/dummy/app/admin/dashboard.rb
Обычный файл
@@ -0,0 +1,32 @@
|
||||
ActiveAdmin.register_page "Dashboard" do
|
||||
menu priority: 1, label: proc { I18n.t("active_admin.dashboard") }
|
||||
|
||||
content title: proc { I18n.t("active_admin.dashboard") } do
|
||||
div class: "blank_slate_container", id: "dashboard_default_message" do
|
||||
span class: "blank_slate" do
|
||||
span I18n.t("active_admin.dashboard_welcome.welcome")
|
||||
small I18n.t("active_admin.dashboard_welcome.call_to_action")
|
||||
end
|
||||
end
|
||||
|
||||
# Here is an example of a simple dashboard with columns and panels.
|
||||
#
|
||||
# columns do
|
||||
# column do
|
||||
# panel "Recent Posts" do
|
||||
# ul do
|
||||
# Post.recent(5).map do |post|
|
||||
# li link_to(post.title, admin_post_path(post))
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# column do
|
||||
# panel "Info" do
|
||||
# para "Welcome to ActiveAdmin."
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end # content
|
||||
end
|
||||
4
spec/dummy/app/admin/posts.rb
Обычный файл
4
spec/dummy/app/admin/posts.rb
Обычный файл
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ActiveAdmin.register Post do
|
||||
end
|
||||
4
spec/dummy/app/admin/tags.rb
Обычный файл
4
spec/dummy/app/admin/tags.rb
Обычный файл
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ActiveAdmin.register Tag do
|
||||
end
|
||||
Ссылка в новой задаче
Block a user