mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Add colour field
This commit is contained in:
parent
4574b63458
commit
824a259d7b
@ -15,7 +15,7 @@ class CategoryDashboard < Administrate::BaseDashboard
|
|||||||
created_at: Field::DateTime,
|
created_at: Field::DateTime,
|
||||||
updated_at: Field::DateTime,
|
updated_at: Field::DateTime,
|
||||||
photo_id: Field::Number,
|
photo_id: Field::Number,
|
||||||
base_colour: Field::String,
|
base_colour: Field::ColourField,
|
||||||
sort: Field::Number,
|
sort: Field::Number,
|
||||||
slug: Field::String,
|
slug: Field::String,
|
||||||
}
|
}
|
||||||
|
|||||||
7
app/fields/colour_field.rb
Normal file
7
app/fields/colour_field.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
require "administrate/field/base"
|
||||||
|
|
||||||
|
class ColourField < Administrate::Field::Base
|
||||||
|
def to_s
|
||||||
|
data
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,2 +1,6 @@
|
|||||||
<%= f.label field.attribute %>
|
<div class="field-unit__label">
|
||||||
<%= f.color_field field.attribute, style: 'height: 2.35em; width: 5em;' %>
|
<%= f.label field.attribute %>
|
||||||
|
</div>
|
||||||
|
<div class="field-unit__field">
|
||||||
|
<%= f.color_field field.attribute, style: 'height: 2.35em; width: 5em;' %>
|
||||||
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user