Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/assets/builds/administrate/application.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/builds/administrate/application.css.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion app/assets/builds/administrate/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -21711,7 +21711,9 @@
var import_jquery2 = __toESM(require_jquery());
var select_controller_default = class extends Controller {
connect() {
(0, import_jquery2.default)(this.element).selectize({});
(0, import_jquery2.default)(this.element).selectize({
allowEmptyOption: true
});
}
};

Expand Down
4 changes: 2 additions & 2 deletions app/assets/builds/administrate/application.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import $ from "jquery";

export default class extends Controller {
connect() {
$(this.element).selectize({});
$(this.element).selectize({
allowEmptyOption: true
});
}
};
5 changes: 5 additions & 0 deletions app/assets/stylesheets/administrate/base/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ select {
outline-offset: $focus-outline-offset;
}
}

.selectize-dropdown [data-selectable][data-value=""].option::after {
content: " ";
display: inline-block;
}
2 changes: 1 addition & 1 deletion spec/example_app/app/dashboards/customer_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CustomerDashboard < Administrate::BaseDashboard
territory: Field::BelongsTo.with_options(
searchable: true,
searchable_fields: ["name"],
include_blank: true
include_blank: I18n.t("helpers.select.prompt")
),
example_time: Field::Time,
password: Field::Password
Expand Down
3 changes: 2 additions & 1 deletion spec/example_app/app/dashboards/product_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class ProductDashboard < Administrate::BaseDashboard
price: Field::Number.with_options(prefix: "$", decimals: 2),
product_meta_tag: Field::HasOne.with_options(order: "meta_title"),
release_year: Field::Select.with_options(
collection: -> { (Time.current.year - 10)..Time.current.year }
collection: -> { (Time.current.year - 10)..Time.current.year },
include_blank: true
)
}

Expand Down