Created
May 4, 2018 08:58
-
-
Save kitsuneyo/0928137196b52930000bf911ffe4ea9a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{{!-- templates/components/my-form.hbs --}} | |
{{#bs-form model=changeset | |
formLayout="vertical" | |
onSubmit=(action submit changeset) | |
class='mb-5' as |form|}} | |
{{!-- other stuff --}} | |
{{form.element controlType="power-select" | |
property="mediaLicense" | |
label="Media license" | |
options=mediaLicenses | |
optionLabelPath="name"}} | |
{{bs-button defaultText="Save" | |
type="primary" | |
buttonType="submit"}} | |
{{/bs-form}} |
This file contains hidden or 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
// routes/show.js | |
model(params) { | |
return RSVP.hash({ | |
image: this.get('store').findRecord('image', params.id), | |
mediaLicenses: this.get('store') | |
.findAll( | |
'media-license', | |
{ fields: { media_licenses: 'name' } } | |
) | |
}); | |
}, |
This file contains hidden or 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
# templates/show.hbs | |
{{my-form changeset=(changeset model.image validations) | |
submit=(action "submit") | |
mediaLicenses=model.mediaLicenses}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment