0

I want to use emberjs to simplify the client-side user interaction and ajax update requests for my rails web site. In emberjs they say:

If you are using build tools to manage your application's assets, most will know how to precompile Handlebars templates and make them available to Ember.js.

and

If you're using build tools, create a Handlebars file at templates/components/blog-post.handlebars

I know how to precompile handlebar templates through the npm handlebars tool, but that does not seem to work with the components since handlebars doesn't care about folder names.

I searched and found ember-tools and ember-cli, but they all seem to work as a server framework. I do not know much about nodejs as server. So I am not sure whether it is appropriate to choose emberjs in my case, and how should I build handlebar templates (such as components) for emberjs client-side usage?

Russell Yan
  • 183
  • 4
  • 15

2 Answers2

1

You can use Ember-CLI, or the Yeoman Ember Generator (https://github.com/yeoman/generator-ember).

Those tools have a server while you are developing for convenience, but they have a build process that generates all-static files (minified js, compiled templates, etc) that you can publish to any server.

Eg, in Ember-CLI you would run

 ember build --environment=production

and it would put the generated (static) files in build/

Also, take a look at Use Forever with Ember-CLI

Community
  • 1
  • 1
Paulo Schreiner
  • 1,046
  • 8
  • 9
0

It seems that I don't have to build templates/components manually, there is a ruby gem that can do that automatically: ember-rails. It is mentioned in GETTING EMBER but I never thought of looking at that page.

Russell Yan
  • 183
  • 4
  • 15