We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
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'
Nice catch! Fixed!
Three cheers for ember cli! Awesome article.
Thanks! :)
Nice tutorial.. but ditch the profanity ;)
I hear ya! "asset pipeline" is a four-letter word to me too.
this is really cool.
kudos nando =)
This post is gold, thank you very much
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
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.
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'
Could you also call the index action rather than naming it bootstrap to get some extra automatic covention?
You can. I just don't how that would help with anything.
great tutorial. ember-cli apps now resolve in the root folder now by default not in app/
Nice post dude! :)
Awesome, thank you.
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!
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?
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?
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).
Killer article! Great share.. thanks!!!
Thanks!
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!
great article, you should submit most of it as a PR to the ember-cli-rails docs
Great guide :D
Wow, I think I'm going to try this on one of my rails apps. Thank you for the detailed guide!
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?
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.
how to use rails api when i try to send requset from ember
get '/*path' => 'ember#bootstrap' catch all request and render html layout
Thanks
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.
Great to see a post with ember-cli.