We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Serabe • 10 years ago

Great to see a post with ember-cli.

kc00l • 10 years ago

Small error in this paragraph:

Let’s check if everything works together. Create a file at 'frontend/app/javascripts/templates/index.hbs' with the following content.

Should be 'frontend/app/templates/index.hbs'

Nando Vieira • 10 years ago

Nice catch! Fixed!

Jared Smith • 10 years ago

Three cheers for ember cli! Awesome article.

Nando Vieira • 10 years ago

Thanks! :)

Tony Collen • 10 years ago

Nice tutorial.. but ditch the profanity ;)

marclipovsky • 10 years ago

I hear ya! "asset pipeline" is a four-letter word to me too.

Amalrik Maia • 10 years ago

this is really cool.
kudos nando =)

Matt Terry • 10 years ago

This post is gold, thank you very much

Cezar Halmagean • 10 years ago

Nice article, but one tiny detail is missing. You need to set up the 'ember' layout in your controller, otherwise it will load the `application.html.erb` layout by default.

So something like this should do the trick:


class EmberController < ApplicationController
layout 'ember'

def bootstrap
end
end

Nando Vieira • 10 years ago

Actually, you don't need this. The layout file is defined based on the controller's name. So, any controller that has a layout file with its name, will use it without any configuration. The application.html.erb is the default layout because we inherit from ApplicationController. If you inherit from a different controller, say Pages < AdminController, then the default layout file is going to be admin.html.erb instead.

You can read more about this on Rails Guides.

Cezar Halmagean • 10 years ago

oh, cool I didn't know that. The reason it didn't work for me was cause I've created a controller with a different name and a layout named 'ember.html.erb'

gwhosubex • 10 years ago

Could you also call the index action rather than naming it bootstrap to get some extra automatic covention?

Nando Vieira • 10 years ago

You can. I just don't how that would help with anything.

Kory Tegman • 10 years ago

great tutorial. ember-cli apps now resolve in the root folder now by default not in app/

dnlserrano • 10 years ago

Nice post dude! :)

Tiger • 10 years ago

Awesome, thank you.

Tiger • 10 years ago

Have you looked at/had any luck with deploying to heroku with this setup? Can't get it working with instructions in the gem README. Thanks!

gwhosubex • 10 years ago

Super helpful article. I think mentioning the differences between embercli and emberclirails would help.

Mentioning how bower fits in and why/where it gets pulled in when using emberclirails would clarify things as well.

Also, regarding the conclusion, isn't there already rail-api?

gwhosubex • 10 years ago

How do you use embercli without emberclirails? If you need a back end, and if you choose rails, don't you need emberclirails? If not, how is the configuring different?

I'm having trouble getting a sense of whether there are multiple mutually exclusive ways of using ember, and what those differences are, and how to do them.

Did we at any point use embercli without rails? In this article?

Constant Meiring • 10 years ago

ember-cli-rails is just a neat way to package Ember.js into a Rails project and compile & serve assets along with it. You could also use ember-cli on it's own to serve the Ember site, and then use Rails separately as an API (or something like Firebase).

Eric Berry • 10 years ago

Killer article! Great share.. thanks!!!

Nando Vieira • 10 years ago

Thanks!

TooNiceSoFar • 10 years ago

This setup would allow me to build something like a "user panel" with Ember.js and a public website seo friendly at the same time?
Thanks for sharing!

Evan • 10 years ago

great article, you should submit most of it as a PR to the ember-cli-rails docs

Christoffer Artmann • 10 years ago

Great guide :D

iamse7en • 10 years ago

Wow, I think I'm going to try this on one of my rails apps. Thank you for the detailed guide!

5minpause • 10 years ago

This is a great starting point. Before I only found older tutorials that didn't work any more.
Do you write about ember/rails regularely?

fullofcaffeine • 10 years ago

Hey Nando, thanks for the article!

How do I specify where exactly in the Rails template markup the `application.hbs` is going to be included? Right now, it's just appended, so it gets inserted *after* all the content area and the footer that's setup by the Rails layout.

april • 10 years ago

how to use rails api when i try to send requset from ember
get '/*path' => 'ember#bootstrap' catch all request and render html layout

Wellington T. • 9 years ago

Thanks

Serguei Cambour • 8 years ago

Great article. Just one typo to fix: you are asking to create frontend.css in a Rails app but you are puttig frontend.scss to assets.rb to be compiled. I haven't tested if it works.