-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Community resource addresses #900
Community resource addresses #900
Conversation
).first_or_create | ||
|
||
community_resource.location = location | ||
community_resource.update permitted_attributes(community_resource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to refactor this using the form design pattern but wanted to at least share what has been done in case someone else has time to get to this before I can.
<%= location_form.input :city, required: true %> | ||
<%= location_form.input :state, required: true, maxlength: 2 %> | ||
<%= location_form.input :zip, required: true, maxlength: 5 %> | ||
<%= location_form.collection_select :location_type_id, LocationType.order(:name), :id, :name, include_blank: false, required: true %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the form field that I cannot figure out how to get a label to display on. I think this may have something to do with Simple Form because even when adding label: "xyz"
I don't have any luck.
@@ -17,7 +17,18 @@ def new | |||
end | |||
|
|||
def create | |||
community_resource.assign_attributes permitted_attributes(community_resource) | |||
location_params = params['community_resource']['location'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Location is not required on a new Community Resource, I will need to add some checks in place here (currently required form fields).
Why
closes #879
What
Previously:
Now:
How
first_or_create
to find or create a new LocationTesting
Next Steps
Outstanding Questions, Concerns and Other Notes
Accessibility
N/A
Security
This issue may need to be reviewed with accessibility and security in mind as I'm not very familiar with how I've impacted them
Pre-Merge Checklist