By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.
To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:
map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do| @SuccessNotifier = React.createClass | |
| render: -> | |
| [image, text] = if this.props.success | |
| ['/images/correct.png','Well done !'] | |
| else | |
| ['/images/wrong.png', 'Wrong answer !'] | |
| <div className="list-group-item"> | |
| <div className="row"> | |
| <div className="col-md-2"> |
| @ResultsDisplay = React.createClass | |
| render: -> | |
| <div className="list-group-item"> | |
| <div className="row"> | |
| <div className="col-md-2"> | |
| <img className='media-object' src="/images/graduated.png" /> | |
| </div> | |
| <div className="col-md-9"> | |
| <h1>The quiz session is finished</h1> | |
| <h3>Here are the results:</h3> |
| git clone [email protected]:supertinou/livequiz.git && cd livequiz && git reset --hard SAMPLE-QUIZ-APP |
| .config(function($provide) { | |
| $provide.decorator("$rootScope", function($delegate) { | |
| var Scope = $delegate.constructor; | |
| var origBroadcast = Scope.prototype.$broadcast; | |
| var origEmit = Scope.prototype.$emit; | |
| Scope.prototype.$broadcast = function($scope) { | |
| console.log("$broadcast was called on $scope " + $scope.$id + " with arguments:", | |
| arguments); | |
| return origBroadcast.apply(this, arguments); |
| // @author: @BenNadel | |
| // Source : http://www.bennadel.com/blog/2592-hooking-into-the-complete-event-of-an-ngrepeat-loop-in-angularjs.htm | |
| angular.module('app') | |
| .directive("repeatComplete", | |
| function( $rootScope ) { | |
| // Because we can have multiple ng-repeat directives in | |
| // the same container, we need a way to differentiate | |
| // the different sets of elements. We'll add a unique ID | |
| // to each set. | |
| var uuid = 0; |