├── log └── .keep ├── output.log ├── app ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ └── example.rb ├── assets │ ├── images │ │ ├── .keep │ │ ├── logo.png │ │ ├── contacts │ │ │ ├── adam.png │ │ │ ├── martin.png │ │ │ └── patty.png │ │ ├── products │ │ │ ├── birch.png │ │ │ ├── flint.png │ │ │ ├── matches.png │ │ │ ├── tinder.png │ │ │ ├── bow-drill.png │ │ │ └── kindling.png │ │ ├── clarendonltstd-webfont.eot │ │ ├── clarendonltstd-webfont.ttf │ │ ├── clarendonltstd-webfont.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── javascripts │ │ └── application.js │ └── stylesheets │ │ └── application.css ├── controllers │ ├── concerns │ │ └── .keep │ ├── products_controller.rb │ ├── reviews_controller.rb │ ├── application_controller.rb │ └── examples_controller.rb ├── helpers │ └── application_helper.rb └── views │ ├── examples │ ├── show.html.erb │ └── index.html.erb │ ├── templates │ ├── _footer.html.erb │ ├── _about.html.erb │ ├── _navigation.html.erb │ ├── _navigation2.html.erb │ ├── _index.html.erb │ ├── _index2.html.erb │ └── _index3.html.erb │ ├── reviews │ └── create.json │ ├── layouts │ └── application.html.erb │ ├── products │ └── index.json │ └── example │ ├── _example_1_10.html.erb │ ├── _example_1_20.html.erb │ ├── _example_1_30.html.erb │ ├── _example_2_10.html.erb │ ├── _example_2_20.html.erb │ ├── _example_2_50.html.erb │ ├── _example_2_60.html.erb │ ├── _example_2_70.html.erb │ ├── _example_3_10.html.erb │ ├── _example_3_20.html.erb │ ├── _example_3_15.html.erb │ ├── _example_3_30.html.erb │ ├── _example_3_50.html.erb │ ├── _example_3_40.html.erb │ ├── _example_3_60.html.erb │ ├── _example_4_50.html.erb │ ├── _example_5_5.html.erb │ ├── _example_4_20.html.erb │ ├── _example_4_10.html.erb │ ├── _example_4_40.html.erb │ ├── _example_4_30.html.erb │ ├── _example_5_7.html.erb │ ├── _example_5_10.html.erb │ └── _example_5_20.html.erb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── demo │ ├── images │ │ ├── logo.png │ │ ├── contacts │ │ │ ├── adam.png │ │ │ ├── martin.png │ │ │ └── patty.png │ │ └── products │ │ │ ├── birch.png │ │ │ ├── flint.png │ │ │ ├── tinder.png │ │ │ ├── kindling.png │ │ │ ├── matches.png │ │ │ └── bow-drill.png │ ├── fonts │ │ ├── clarendonltstd-webfont.eot │ │ ├── clarendonltstd-webfont.ttf │ │ ├── clarendonltstd-webfont.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── application.css │ ├── todo.md │ ├── less │ │ ├── component-animations.less │ │ ├── wells.less │ │ ├── breadcrumbs.less │ │ ├── thumbnails.less │ │ ├── close.less │ │ ├── settings.less │ │ ├── utilities.less │ │ ├── media.less │ │ ├── jumbotron.less │ │ ├── pager.less │ │ ├── badges.less │ │ ├── labels.less │ │ ├── bootstrap.less │ │ ├── code.less │ │ ├── alerts.less │ │ ├── list-group.less │ │ ├── print.less │ │ ├── pagination.less │ │ ├── progress-bars.less │ │ ├── scaffolding.less │ │ ├── grid.less │ │ ├── tooltip.less │ │ ├── modals.less │ │ ├── popovers.less │ │ ├── input-groups.less │ │ ├── buttons.less │ │ ├── panels.less │ │ ├── dropdowns.less │ │ ├── tables.less │ │ ├── carousel.less │ │ ├── responsive-utilities.less │ │ └── type.less │ └── css │ │ └── application.css ├── robots.txt ├── products ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep ├── controllers │ └── .keep ├── fixtures │ └── .keep ├── integration │ └── .keep └── test_helper.rb ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── bin ├── rake ├── bundle └── rails ├── config.ru ├── config ├── environment.rb ├── initializers │ ├── session_store.rb │ ├── filter_parameter_logging.rb │ ├── mime_types.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── secret_token.rb ├── boot.rb ├── routes.rb ├── database.yml ├── locales │ └── en.yml ├── application.rb └── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── db ├── migrate │ ├── 20131007194224_add_description_to_examples.rb │ └── 20131007184412_create_examples.rb └── schema.rb ├── Rakefile ├── Gemfile ├── .gitignore ├── README.md └── Gemfile.lock /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /output.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/views/examples/show.html.erb: -------------------------------------------------------------------------------- 1 | <%= render partial: "example/example_#{@example.level}_#{@example.number}" %> -------------------------------------------------------------------------------- /app/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/logo.png -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /public/demo/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/logo.png -------------------------------------------------------------------------------- /app/assets/images/contacts/adam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/contacts/adam.png -------------------------------------------------------------------------------- /app/assets/images/contacts/martin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/contacts/martin.png -------------------------------------------------------------------------------- /app/assets/images/contacts/patty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/contacts/patty.png -------------------------------------------------------------------------------- /app/assets/images/products/birch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/birch.png -------------------------------------------------------------------------------- /app/assets/images/products/flint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/flint.png -------------------------------------------------------------------------------- /app/assets/images/products/matches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/matches.png -------------------------------------------------------------------------------- /app/assets/images/products/tinder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/tinder.png -------------------------------------------------------------------------------- /public/demo/images/contacts/adam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/contacts/adam.png -------------------------------------------------------------------------------- /public/demo/images/contacts/martin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/contacts/martin.png -------------------------------------------------------------------------------- /public/demo/images/contacts/patty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/contacts/patty.png -------------------------------------------------------------------------------- /public/demo/images/products/birch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/birch.png -------------------------------------------------------------------------------- /public/demo/images/products/flint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/flint.png -------------------------------------------------------------------------------- /public/demo/images/products/tinder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/tinder.png -------------------------------------------------------------------------------- /app/assets/images/products/bow-drill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/bow-drill.png -------------------------------------------------------------------------------- /app/assets/images/products/kindling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/products/kindling.png -------------------------------------------------------------------------------- /public/demo/images/products/kindling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/kindling.png -------------------------------------------------------------------------------- /public/demo/images/products/matches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/matches.png -------------------------------------------------------------------------------- /public/demo/images/products/bow-drill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/images/products/bow-drill.png -------------------------------------------------------------------------------- /app/assets/images/clarendonltstd-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/clarendonltstd-webfont.eot -------------------------------------------------------------------------------- /app/assets/images/clarendonltstd-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/clarendonltstd-webfont.ttf -------------------------------------------------------------------------------- /app/assets/images/clarendonltstd-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/clarendonltstd-webfont.woff -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /public/demo/fonts/clarendonltstd-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/clarendonltstd-webfont.eot -------------------------------------------------------------------------------- /public/demo/fonts/clarendonltstd-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/clarendonltstd-webfont.ttf -------------------------------------------------------------------------------- /public/demo/fonts/clarendonltstd-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/clarendonltstd-webfont.woff -------------------------------------------------------------------------------- /app/assets/images/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /app/assets/images/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/demo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/demo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /app/assets/images/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/app/assets/images/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/demo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeschool/EmberCourseDemo/HEAD/public/demo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/controllers/products_controller.rb: -------------------------------------------------------------------------------- 1 | class ProductsController < ApplicationController 2 | 3 | 4 | layout false 5 | 6 | def index 7 | render 8 | end 9 | end -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /app/views/templates/_footer.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/reviews/create.json: -------------------------------------------------------------------------------- 1 | { "reviews": [{ "id": 102, "product": 1, "text": "Even though there was snow everywhere, this did the trick!", "reviewedAt": "2013-12-13 08:00:00" }] } -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | EmberDemo::Application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | EmberDemo::Application.config.session_store :cookie_store, key: '_EmberDemo_session' 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /db/migrate/20131007194224_add_description_to_examples.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToExamples < ActiveRecord::Migration 2 | def change 3 | add_column :examples, :description, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/example.rb: -------------------------------------------------------------------------------- 1 | class Example < ActiveRecord::Base 2 | 3 | def details 4 | description ? Kramdown::Document.new(description).to_html : "" 5 | end 6 | 7 | def to_param 8 | "#{level}-#{number}" 9 | end 10 | end -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /app/controllers/reviews_controller.rb: -------------------------------------------------------------------------------- 1 | class ReviewsController < ApplicationController 2 | 3 | skip_before_filter :verify_authenticity_token 4 | 5 | layout false 6 | 7 | def create 8 | review = params[:review] 9 | end 10 | end -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131007184412_create_examples.rb: -------------------------------------------------------------------------------- 1 | class CreateExamples < ActiveRecord::Migration 2 | def change 3 | create_table :examples do |t| 4 | t.string :title 5 | t.integer :level 6 | t.integer :number 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | EmberDemo::Application.routes.draw do 2 | #root 'examples#index' 3 | 4 | root :to => "examples#show", id: "3-50" 5 | resources :examples, only: [:show, :index] 6 | # resources :products, only: [:index] 7 | resources :reviews, only: [:create] 8 | end -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | EmberDemo::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/views/templates/_about.html.erb: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 4 | gem 'rails', '4.0.0' 5 | gem 'sqlite3' 6 | 7 | gem 'sass-rails', '~> 4.0.0' 8 | gem 'uglifier', '>= 1.3.0' 9 | gem 'coffee-rails', '~> 4.0.0' 10 | gem 'jquery-rails' 11 | gem 'kramdown' 12 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The Flint & Flame 6 | <%= stylesheet_link_tag :application %> 7 | <%= javascript_include_tag :application %> 8 | 9 | 10 | <%= yield %> 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/views/examples/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

Examples

3 | 4 | 12 |
-------------------------------------------------------------------------------- /public/demo/application.css: -------------------------------------------------------------------------------- 1 | .label a { color: #fff; text-decoration: underline; } 2 | 3 | .product-detail.row { 4 | margin: 1em 0; 5 | border-bottom: 1px solid #eee; 6 | } 7 | .product-detail img { 8 | max-height: 150px; 9 | max-width: 150px; 10 | } 11 | .product-detail h2 { 12 | margin-top: 0; 13 | margin-bottom: 10px; 14 | } 15 | 16 | .nav > li { cursor: pointer; } -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /public/demo/todo.md: -------------------------------------------------------------------------------- 1 | ## Cart 2 | 3 | * Make the "Add to Cart" button do something. 4 | * Show the items in cart / total in cart in the header or application template 5 | 6 | ## Products 7 | 8 | * Clean up the "All 6 Products" link in comparison to the Filtered product links. Is it possible to have these in the same group without highlighting the parent route? 9 | * Add images for products 10 | 11 | 12 | ## Goals 13 | 14 | * See what can be done to make it more themed. How is this a store for stolen goods? 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | 18 | .DS_Store 19 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | ActiveRecord::Migration.check_pending! 7 | 8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 9 | # 10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 11 | # -- they do not yet inherit this setting 12 | fixtures :all 13 | 14 | # Add more helper methods to be used by all tests here... 15 | end 16 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /app/controllers/examples_controller.rb: -------------------------------------------------------------------------------- 1 | class ExamplesController < ApplicationController 2 | respond_to :html 3 | 4 | #layout choose_layout 5 | 6 | def index 7 | respond_with @examples = Example.order(:level, :number) 8 | end 9 | 10 | def show 11 | level = params[:id].split("-").first 12 | number = params[:id].split("-").last 13 | @example = Example.find_by number: number, level: level 14 | end 15 | 16 | private 17 | 18 | def choose_layout 19 | if params[:action] == 'show' 20 | return 'ember' 21 | else 22 | return 'application' 23 | end 24 | end 25 | end -------------------------------------------------------------------------------- /public/demo/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /public/demo/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid darken(@well-bg, 7%); 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /public/demo/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: 8px 15px; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1); 13 | > li { 14 | display: inline-block; 15 | + li:before { 16 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 17 | padding: 0 5px; 18 | color: @breadcrumb-color; 19 | } 20 | } 21 | > .active { 22 | color: @breadcrumb-active-color; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | EmberDemo::Application.config.secret_key_base = '41718ed75ed1b9e405f2ef23c4fbf03e2b45c2f1f9658f088076dd9049d2e036a634971d374349668c33476a1da5de8f2c7b4f3463de055f7b50e4f3497ff685' 13 | -------------------------------------------------------------------------------- /public/demo/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | .img-thumbnail(); 9 | display: block; // Override the inline-block from `.img-thumbnail` 10 | margin-bottom: @line-height-computed; 11 | 12 | > img { 13 | .img-responsive(); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | 18 | // Add a hover state for linked versions only 19 | a&:hover, 20 | a&:focus, 21 | a&.active { 22 | border-color: @link-color; 23 | } 24 | 25 | // Image captions 26 | .caption { 27 | padding: @thumbnail-caption-padding; 28 | color: @thumbnail-caption-color; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require bootstrap 15 | //= require handlebars 16 | //= require markdown 17 | //= require ember 18 | //= require ember-data 19 | //= require_tree . 20 | -------------------------------------------------------------------------------- /app/views/templates/_navigation.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/demo/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/demo/less/settings.less: -------------------------------------------------------------------------------- 1 | // ************************************* 2 | // 3 | // Settings 4 | // -> Fonts, Variables 5 | // 6 | // ************************************* 7 | 8 | // ------------------------------------- 9 | // @font-face 10 | // ------------------------------------- 11 | 12 | // ----- Clarendon ----- // 13 | 14 | @font-face { 15 | font-family: 'clarendon'; 16 | src: url('../fonts/clarendonltstd-webfont.eot'); 17 | src: url('../fonts/clarendonltstd-webfont.eot?#iefix') format('embedded-opentype'), 18 | url('../fonts/clarendonltstd-webfont.woff') format('woff'), 19 | url('../fonts/clarendonltstd-webfont.ttf') format('truetype'), 20 | url('../fonts/clarendonltstd-webfont.svg#clarendon_lt_stdregular') format('svg'); 21 | font-weight: normal; 22 | font-style: normal; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/views/products/index.json: -------------------------------------------------------------------------------- 1 | { "products": [ 2 | { 3 | "id": 1, 4 | "title": "Flint", 5 | "price": 99, 6 | "description": "Flint is a hard, sedimentary cryptocrystalline form of the mineral quartz, categorized as a variety of chert.", 7 | "isOnSale": true, 8 | "image": "/assets/products/flint.png", 9 | "reviews": [100,101] 10 | }, 11 | { 12 | "id": 2, 13 | "title": "Kindling", 14 | "price": 249, 15 | "description": "Easily combustible small sticks or twigs used for starting a fire.", 16 | "isOnSale": false, 17 | "image": "/assets/products/kindling.png", 18 | "reviews": [] 19 | } 20 | ], 21 | "reviews": [ 22 | { "id": 100, "product": 1, "text": "Started a fire in no time!" }, 23 | { "id": 101, "product": 1, "text": "Not the brightest flame, but warm!" } 24 | ] 25 | } -------------------------------------------------------------------------------- /app/views/templates/_navigation2.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/products: -------------------------------------------------------------------------------- 1 | { "products": [ 2 | { 3 | "id": 1, 4 | "title": "Flint", 5 | "price": 99, 6 | "description": "Flint is a hard, sedimentary cryptocrystalline form of the mineral quartz, categorized as a variety of chert.", 7 | "isOnSale": true, 8 | "image": "/assets/products/flint.png", 9 | "reviews": [100,101] 10 | }, 11 | { 12 | "id": 2, 13 | "title": "Kindling", 14 | "price": 249, 15 | "description": "Easily combustible small sticks or twigs used for starting a fire.", 16 | "isOnSale": false, 17 | "image": "/assets/products/kindling.png", 18 | "reviews": [] 19 | } 20 | ], 21 | "reviews": [ 22 | { "id": 100, "product": 1, "text": "Started a fire in no time!", "reviewedAt": "2013-12-10 08:00:00" }, 23 | { "id": 101, "product": 1, "text": "Not the brightest flame, but warm!", "reviewedAt": "2013-12-12 08:00:00" } 24 | ] 25 | } -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20131007194224) do 15 | 16 | create_table "examples", force: true do |t| 17 | t.string "title" 18 | t.integer "level" 19 | t.integer "number" 20 | t.text "description" 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /public/demo/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /app/views/example/_example_1_10.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/views/example/_example_1_20.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) 8 | 9 | module EmberDemo 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /public/demo/css/application.css: -------------------------------------------------------------------------------- 1 | .tagline { 2 | margin-bottom: 20px; 3 | } 4 | 5 | .label a { 6 | color: #fff; 7 | text-decoration: none; 8 | } 9 | 10 | .product-detail.row { 11 | margin: 1em 0; 12 | border-bottom: 1px solid #eee; 13 | } 14 | .product-detail img { 15 | max-height: 150px; 16 | max-width: 150px; 17 | } 18 | .product-detail h2 { 19 | margin-top: 0; 20 | margin-bottom: 0px; 21 | } 22 | .product-description { 23 | margin-top: 10px; 24 | } 25 | 26 | .list-rating { 27 | margin: 0; 28 | padding: 0; 29 | } 30 | .list-rating li { 31 | display: inline; 32 | list-style-type: none; 33 | } 34 | 35 | 36 | 37 | .navbar-default .navbar-nav > li { 38 | cursor: pointer; 39 | background-color: #824d3d; 40 | padding: 12px 12px; 41 | margin-top: -7px; 42 | color: #f0eee1; 43 | font-weight: bold; 44 | } 45 | .navbar-default .navbar-nav > li:hover { 46 | background-color: #e87714; 47 | } 48 | .navbar-default .navbar-nav > li.active { 49 | color: #fff; 50 | background-color: #b65a31; 51 | } 52 | 53 | textarea { 54 | width: 100%; 55 | margin-bottom: 10px; 56 | } -------------------------------------------------------------------------------- /public/demo/less/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /public/demo/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | font-size: @jumbotron-font-size; 10 | font-weight: 200; 11 | box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.15); 12 | line-height: (@line-height-base * 1.5); 13 | color: @jumbotron-color; 14 | background-color: @jumbotron-bg; 15 | 16 | h1 { 17 | line-height: 1; 18 | color: @jumbotron-heading-color; 19 | } 20 | p { 21 | line-height: 1.4; 22 | } 23 | 24 | .container & { 25 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 26 | } 27 | 28 | @media screen and (min-width: @screen-sm-min) { 29 | padding-top: (@jumbotron-padding * 1.6); 30 | padding-bottom: (@jumbotron-padding * 1); 31 | 32 | .container & { 33 | padding-left: (@jumbotron-padding * 2); 34 | padding-right: (@jumbotron-padding * 2); 35 | } 36 | 37 | h1 { 38 | font-size: (@font-size-base * 3.8); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/demo/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | .clearfix(); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pagination-bg; 19 | border: 1px solid @pagination-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pagination-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pagination-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/views/example/_example_1_30.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/views/example/_example_2_10.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/views/example/_example_2_20.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /public/demo/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | } 26 | 27 | // Hover state, but only for links 28 | a.badge { 29 | &:hover, 30 | &:focus { 31 | color: @badge-link-hover-color; 32 | text-decoration: none; 33 | cursor: pointer; 34 | } 35 | } 36 | 37 | // Quick fix for labels/badges in buttons 38 | .btn .badge { 39 | position: relative; 40 | top: -1px; 41 | } 42 | 43 | // Account for counters in navs 44 | a.list-group-item.active > .badge, 45 | .nav-pills > .active > a > .badge { 46 | color: @badge-active-color; 47 | background-color: @badge-active-bg; 48 | } 49 | .nav-pills > li > a > .badge { 50 | margin-left: 3px; 51 | } 52 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | EmberDemo::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /public/demo/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | } 32 | 33 | // Colors 34 | // Contextual variations (linked labels get darker on :hover) 35 | 36 | .label-default { 37 | .label-variant(@label-default-bg); 38 | } 39 | 40 | .label-primary { 41 | .label-variant(@label-primary-bg); 42 | } 43 | 44 | .label-success { 45 | .label-variant(@label-success-bg); 46 | } 47 | 48 | .label-info { 49 | .label-variant(@label-info-bg); 50 | } 51 | 52 | .label-warning { 53 | .label-variant(@label-warning-bg); 54 | } 55 | 56 | .label-danger { 57 | .label-variant(@label-danger-bg); 58 | } 59 | -------------------------------------------------------------------------------- /public/demo/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | 9 | // Core CSS 10 | @import "settings.less"; 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "glyphicons.less"; 22 | @import "dropdowns.less"; 23 | @import "button-groups.less"; 24 | @import "input-groups.less"; 25 | @import "navs.less"; 26 | @import "navbar.less"; 27 | @import "breadcrumbs.less"; 28 | @import "pagination.less"; 29 | @import "pager.less"; 30 | @import "labels.less"; 31 | @import "badges.less"; 32 | @import "jumbotron.less"; 33 | @import "thumbnails.less"; 34 | @import "alerts.less"; 35 | @import "progress-bars.less"; 36 | @import "media.less"; 37 | @import "list-group.less"; 38 | @import "panels.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /public/demo/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | white-space: nowrap; 21 | border-radius: @border-radius-base; 22 | } 23 | 24 | // Blocks of code 25 | pre { 26 | display: block; 27 | padding: ((@line-height-computed - 1) / 2); 28 | margin: 0 0 (@line-height-computed / 2); 29 | font-size: (@font-size-base - 1); // 14px to 13px 30 | line-height: @line-height-base; 31 | word-break: break-all; 32 | word-wrap: break-word; 33 | color: @pre-color; 34 | background-color: @pre-bg; 35 | border: 1px solid @pre-border-color; 36 | border-radius: @border-radius-base; 37 | 38 | // Account for some code outputs that place code tags in pre tags 39 | code { 40 | padding: 0; 41 | font-size: inherit; 42 | color: inherit; 43 | white-space: pre-wrap; 44 | background-color: transparent; 45 | border-radius: 0; 46 | } 47 | } 48 | 49 | // Enable scrollable blocks of code 50 | .pre-scrollable { 51 | max-height: @pre-scrollable-max-height; 52 | overflow-y: scroll; 53 | } 54 | -------------------------------------------------------------------------------- /app/views/example/_example_2_50.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/views/example/_example_2_60.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

We're sorry, but something went wrong.

54 |
55 |

If you are the application owner check the logs for more information.

56 | 57 | 58 | -------------------------------------------------------------------------------- /app/views/example/_example_2_70.html.erb: -------------------------------------------------------------------------------- 1 | 22 | 23 | 29 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The change you wanted was rejected.

54 |

Maybe you tried to change something you didn't have access to.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The page you were looking for doesn't exist.

54 |

You may have mistyped the address or the page may have moved.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | EmberDemo::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /app/views/templates/_index.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/demo/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissable alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable { 41 | padding-right: (@alert-padding + 20); 42 | 43 | // Adjust close link position 44 | .close { 45 | position: relative; 46 | top: -2px; 47 | right: -21px; 48 | color: inherit; 49 | } 50 | } 51 | 52 | // Alternate styles 53 | // 54 | // Generate contextual modifier classes for colorizing the alert. 55 | 56 | .alert-success { 57 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 58 | } 59 | .alert-info { 60 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 61 | } 62 | .alert-warning { 63 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 64 | } 65 | .alert-danger { 66 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 67 | } 68 | -------------------------------------------------------------------------------- /app/views/templates/_index2.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/templates/_index3.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This is the companion code for the Code Schools Ember course. This showcases the code used in the slides. 4 | 5 | ## Complete Example 6 | 7 | The finished application can be found at `demo/index.html`. Open that up in your browser and you're good to go! 8 | 9 | If you want to see what the application looked like at a specific state during the course, you can go the more elaborate route and set up the Rails application which allows for serving the ember app at each point we show it during the slides. 10 | 11 | ## Setup 12 | 13 | This is a Ruby on Rails application, so in order to run it you'll need to have Ruby 1.9.3. Here's the setup you'll need to do to in order to see the examples. 14 | 15 | First off, you'll need to have Ruby installed. We recommend using either [rbenv](https://github.com/sstephenson/rbenv) or [RVM](https://rvm.io/), but your system Ruby will suffice as well. Code School has a [Code TV](https://www.codeschool.com/code_tv/rvm) on using RVM as well. 16 | 17 | With Ruby installed, make sure to install the bundler gem. 18 | 19 | ``` 20 | $ gem install bundler 21 | ``` 22 | 23 | Next, download or clone this repository, change directory into it, and `bundle`. 24 | 25 | ``` 26 | $ git clone https://github.com/codeschool/EmberCourseDemo.git 27 | $ cd EmberCourseDemo 28 | EmberCourseDemo $ bundle install 29 | ``` 30 | 31 | Next, setup the database -- which contains information on the code samples used in the course. 32 | 33 | ``` 34 | EmberCourseDemo $ bundle exec rake db:setup 35 | ``` 36 | 37 | ## Running 38 | 39 | After that, you should be all set to run the application: 40 | 41 | ``` 42 | EmberCourseDemo $ bundle exec rails s 43 | ``` 44 | 45 | This will start the application on port 3000. Open up [http://localhost:3000/examples](http://localhost:3000/examples) in a browser and head to any code sample. 46 | -------------------------------------------------------------------------------- /public/demo/less/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | // Base class 6 | // 7 | // Easily usable on