-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Implement multiple option for select field (#3572)
* Implement multiple select feature for the sizes column of the products table * Update select_field.rb Co-authored-by: Paul Bob <[email protected]> * Update select_field_spec.rb Co-authored-by: Paul Bob <[email protected]> * Update select_field_spec.rb Co-authored-by: Paul Bob <[email protected]> * Update to multiple select PR * Update select field spec file * Move sanitization of multiple select field to be handled by the controller instead of model * Fix Lint issues raised by Rubocop * Fix migration version error thrown with rails 8 plus lint issues * fix migration version * Update spec/dummy/db/schema.rb * fix select show component when `multiple: true` * show array on display_value * fix multiple syntax * show component tests * lint --------- Co-authored-by: Paul Bob <[email protected]> Co-authored-by: Paul Bob <[email protected]>
- Loading branch information
1 parent
f806429
commit 2f82224
Showing
7 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<%= field_wrapper(**field_wrapper_args.merge(dash_if_blank: false)) do %> | ||
<%= @field.value.nil? ? "—" : @field.label %> | ||
<%= @field.label %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddSizesToProducts < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :products, :sizes, :string, array: true, default: [] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters