I’ve been building an Ember application using Rails and ember-cli-rails. It has been fantastic so far- however I’ve run into an annoying issue with template rendering.
I am using the carrierwave-direct gem to upload large files directly to S3. The gem includes a form helper which helps create the form with all of the keys and information for S3.
Because the form is complex, I decided to generate the form in the application.html.erb file then reference the resulting ‘template’ using a {{partial}} helper in the .hbs templates.
My application.html.erb looks something like this:
#application.html.erb
...
<body>
...
<script type='text/html' data-template-name='direct-upload-form'><%= form_tag_helper......%></script>
</body>
...
The Ember app is an Ember CLI app (using ember-cli-rails) and I’ve created a direct-upload-form component whose template reads:
#direct-upload-form.hbs
{{partial 'direct-upload-form' }}
However, upon page load I receive the error
Unable to find partial with name "direct-upload-form"
Now, I know that templates render server-side, but is there a way to have it reference a client-side template instead?