Giter Club home page Giter Club logo

emberjs-rails's Introduction

EmberJs-Rails

Ember.js for Rails 3.1.

Getting started

Add the gem to your application Gemfile:

gem "emberjs-rails"

Run bundle install

Change the layout for your views to 'ember' and you will get the boilerplate html5 layout from the Ember.js starter kit. In your view you can do:

<% content_for :title { 'Demo Ember.js Application' }
   content_for :description { 'Demo Ember.js Application from outer space.' }
   content_for :author { 'Demo User <[email protected]>' } %>

Run bundle install and add the following line to

Rails will serve HandlebarsJS templates to Ember.js by putting each template in a dedicated ".js.hjs" file (e.g. app/assets/javascripts/templates/admin_panel.js.hjs) and including the assets in your view:

<%= javascript_include_tag "templates/admin_panel" %>

By default your view content will be yielded into the document body, if you want to put your javascript_include_tag statements in the document head then you can wrap it in content_for :head { ... }.

You can bundle all templates together thanks to Sprockets, e.g create app/assets/javascripts/templates/all.js with:

//= require_tree .

Now a single line in the view loads everything:

<%= javascript_include_tag "templates/all" %>

Feedback

If you have any problems or suggestions please feel free to raise a Github issue on the project page.

Miscellania

The original sproutcore-rails author did not include a license with his gem, so I have not added one. My contributions can be assumed to be under the MIT license.

emberjs-rails's People

Contributors

jcxplorer avatar jimsynz avatar matiaskorhonen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.