Skip to content

Commit e684a1b

Browse files
committed
feat(admin/invoice): include picture for shrine cases
1 parent 588fbac commit e684a1b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

spec/dummy/app/admin/invoices.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ActiveAdmin.register Invoice do
2-
permit_params :legal_date, :number, :paid, :state, :attachment, :photo, :category_id,
3-
:city_id, :amount, :color, :updated_at, :active, item_ids: [], other_item_ids: []
2+
permit_params :legal_date, :number, :paid, :state, :attachment, :photo, :category_id, :city_id,
3+
:amount, :color, :updated_at, :picture, :active, item_ids: [], other_item_ids: []
44

55
filter :id, as: :numeric_range_filter
66

@@ -17,6 +17,7 @@
1717
tag_column :state, interactive: true
1818
bool_column :paid
1919
image_column :photo, style: :thumb
20+
image_column :picture, style: :jpg_small
2021
attachment_column :attachment
2122
number_column :amount, as: :currency, unit: "$", separator: ","
2223
toggle_bool_column :active
@@ -35,6 +36,7 @@
3536
list_row :details, localize: true
3637
image_row("Mi foto", :photo, style: :big, &:photo)
3738
attachment_row("My doc", :attachment, label: 'Download file', truncate: false, &:attachment)
39+
image_row("Mi picture", :picture, image_options: { width: 100 }, &:picture)
3840
row :legal_date
3941
number_row("Monto", :amount, as: :human, &:amount)
4042
row :city
@@ -87,6 +89,8 @@
8789

8890
f.input :photo
8991

92+
f.input :picture, as: :file
93+
9094
f.input :color, as: :color_picker,
9195
palette: Invoice.colors
9296

0 commit comments

Comments
 (0)