GithubHelp home page GithubHelp logo

kristianmandrup / ember-bootstrap-rails-demo Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 2.0 289 KB

Demo rails 4 app for ember-bootstrap-rails gem, showing off how to use the helpers included :)

Ruby 49.84% CoffeeScript 24.20% JavaScript 25.96%

ember-bootstrap-rails-demo's Introduction

Welcome to Ember Bootstrap Rails Demo app

This app will demonstrate using ember-bootstrap-rails

The application will be built almost entirely using the bootstrap helpers.

The top bar will contain a menu where you can navigate to each page, demonstrating the various bootstrap Views and Handlebars helpers.

Important

Please help out with this demo app and the ember-bootstrap-rails library!

Fork it, fix/improve it and make a pull request :)

Thanks!

The steps involved

  1. Adjust application.rb

We only need the following!

require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"

We add some Sweet routing macros using a routing.rb initializer. Sweet!

Note: We could also use the sweet_routing gem

  1. Add route to 'root' page at 'application#index'
  2. Adjust application layout file (empty body - will be filled by Ember.js)
  3. Add index.html file that contains script with app initialization

For Rails 4:

Remove config/initializers/wrap_parameters.rb

Adjust environment files.

Remove whiny_nils, config.eager_load = false and add config.ember.variant = :development

Install Ember.js

We like ember with coffee ;)

rails g ember:bootstrap -g --javascript-engine coffee

Change filename of <my_app>.js.coffee to just app.js.coffee.

Convert //= require to #= require in app.js.coffee

Change name of ember Application namespace :)

MyApp = Ember.Application.create(); becomes simply window.App = Ember.Application.create()

To setup testing we will use Konacha and Sinon.

To see Konacha live in action, check out this video. AWESOME!

We use the ember-konacha-rails gem.

We also have RubyJS via rubyjs-rails. We wanna make our coffee even sweeter, yet stronger!

To make it all extra delicious, we add slim for templating the index page. We also spice up with Emblem js via emblem-rails to replace the default Handlebars templating on the Ember side ;)

Nice!

Setup testing environment

Options first!

rails g ember_konacha:install --help

Let's install Konacha testing environment!

rails g ember_konacha:install --guide

To be continued...

ember-bootstrap-rails-demo's People

Contributors

kristianmandrup avatar zencocoon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.