-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce2bfbb
commit 2079d93
Showing
5 changed files
with
57 additions
and
9 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
18 changes: 15 additions & 3 deletions
18
test/dummy/app/views/comboboxes/multiselect_new_values.html.erb
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,13 +1,25 @@ | ||
<%= tag.style nonce: content_security_policy_nonce do %> | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
input[type="submit"] { | ||
padding: 0.5rem; | ||
} | ||
<% end %> | ||
|
||
<% if flash[:notice] %> | ||
<p><%= flash[:notice] %></p> | ||
<% end %> | ||
|
||
<%= form_with model: @user, url: user_visits_url(@user), method: :post, html: { style: "display: flex; flex-direction: column; gap: 1rem;" } do |form| %> | ||
<%= form_with model: @user, url: user_visits_url(@user), method: :post do |form| %> | ||
<%= combobox_tag "user[visited_states]", | ||
State.all, | ||
id: "states-field", | ||
label: "Visited states (new allowed)", | ||
multiselect_chip_src: possibly_new_state_chips_path, | ||
name_when_new: "user[visited_states]" %> | ||
<%= form.submit style: "padding: 0.5rem;" %> | ||
free_text: true %> | ||
<%= form.submit %> | ||
<% end %> |
16 changes: 14 additions & 2 deletions
16
test/dummy/app/views/comboboxes/multiselect_prefilled_form.html.erb
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,8 +1,20 @@ | ||
<%= tag.style nonce: content_security_policy_nonce do %> | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
input[type="submit"] { | ||
padding: 0.5rem; | ||
} | ||
<% end %> | ||
|
||
<% if flash[:notice] %> | ||
<p><%= flash[:notice] %></p> | ||
<% end %> | ||
|
||
<%= form_with model: @user, html: { style: "display: flex; flex-direction: column; gap: 1rem;" } do |form| %> | ||
<%= form_with model: @user do |form| %> | ||
<%= form.combobox :visited_state_ids, State.all, label: "Visited states", multiselect_chip_src: state_chips_path %> | ||
<%= form.submit style: "padding: 0.5rem;" %> | ||
<%= form.submit %> | ||
<% 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