-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: set radio button checked according to form field (#445)
- Loading branch information
Showing
6 changed files
with
40 additions
and
10 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
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,5 +1,5 @@ | ||
class Product | ||
include ActiveModel::Model | ||
|
||
attr_accessor :title, :status, :country, :selected_markets, :tags | ||
attr_accessor :title, :status, :country, :selected_markets, :tags, :access | ||
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
6 changes: 2 additions & 4 deletions
6
demo/app/previews/form_builder_component_preview/radio_button.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,11 @@ | ||
<%= form_with(model: product, builder: Polaris::FormBuilder) do |form| %> | ||
<%= form.polaris_radio_button(:access, | ||
value: :allow, | ||
label: "Allow access", | ||
checked: true, | ||
label: "Allow access" | ||
) %> | ||
<%= form.polaris_radio_button(:access, | ||
value: :deny, | ||
label: "Deny access", | ||
checked: false, | ||
label: "Deny access" | ||
) %> | ||
<% 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