This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tax_rates = [ | |
| { country: 'BE', percentage: 21 }, | |
| { country: 'BG', percentage: 20 }, | |
| { country: 'CZ', percentage: 21 }, | |
| { country: 'DK', percentage: 25 }, | |
| { country: 'DE', percentage: 19 }, | |
| { country: 'EE', percentage: 20 }, | |
| { country: 'IE', percentage: 23 }, | |
| { country: 'GR', percentage: 24 }, | |
| { country: 'ES', percentage: 21 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <silence>0.5</silence> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.CurrentUserController = Ember.ObjectController.extend | |
| init: -> | |
| @setCurrentUserFromDom() | |
| setCurrentUserFromDom: -> | |
| attributes = $('meta[name="current-user"]').attr('content') | |
| if attributes | |
| attributes = JSON.parse(attributes) | |
| App.store.load App.User, attributes | |
| user = App.User.find attributes.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !!! | |
| %html | |
| %head | |
| %title | |
| = 'Title' | |
| %meta{charset: 'utf-8'} | |
| - if user_signed_in? | |
| %meta{name: 'current-user', content: current_user.to_json} | |
| = stylesheet_link_tag 'application' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scope '/api' do | |
| resources :users, except: [:edit] | |
| end | |
| root to: 'ember#index' | |
| get '*path' => 'ember#index' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MessagesController < ActionController::Base | |
| def create | |
| @message = Message.create! message_params | |
| MessageTranslator.new(@message).translate! # Sends a request to Google Translate API | |
| MessagePusher.new(@message).push! # Pushes to Pusher.com | |
| end | |
| def update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PostController < ActionController::Base | |
| before_action :set_post, except: [:index, :new, :create] | |
| def show | |
| # do something with @post | |
| end | |
| private | |
| def set_post | |
| @post = Post.find(params[:id]) |