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
| <table class="table table-bordered"> | |
| {{#each_in_group this}} | |
| {{view App.ShowNoteView noteBinding="this"}} | |
| {{/each_in_group}} | |
| </table> | |
| //a helper for iteration | |
| Handlebars.registerHelper('each_in_group', function(context, options) { | |
| var date = options.contexts[0], //the argument | |
| group = App.notesController.get('dates_notes')[date], |
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
| #!/usr/bin/env rake | |
| # Add your own tasks in files placed in lib/tasks ending in .rake, | |
| # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | |
| require File.expand_path('../config/application', __FILE__) | |
| MyApp::Application.load_tasks | |
| Rake.application.options.trace = true | |
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
| $ RAILS_ENV=test bundle exec rake SPEC=vendor/extensions/events/app/controllers/refinery/events/events_controller.rb | |
| /Users/bluestar007/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec vendor/extensions/events/app/controllers/refinery/events/events_controller.rb | |
| /Users/bluestar007/projects/oconnor-davies/vendor/extensions/events/app/controllers/refinery/events/events_controller.rb:3:in `<module:Events>': uninitialized constant ApplicationController (NameError) | |
| from /Users/bluestar007/projects/oconnor-davies/vendor/extensions/events/app/controllers/refinery/events/events_controller.rb:2:in `<module:Refinery>' | |
| from /Users/bluestar007/projects/oconnor-davies/vendor/extensions/events/app/controllers/refinery/events/events_controller.rb:1:in `<top (required)>' | |
| from /Users/bluestar007/.rvm/gems/ruby-1.9.3-p194@od/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load' | |
| from /Users/bluestar007/.rvm/gems/ruby-1.9.3-p194@od/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `block in load_spec_f |
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
| var Document = Backbone.Model.extend({ | |
| initialize: function() { | |
| var categories = new App.Collections.Categories(); | |
| var self = this; | |
| categories.url = function() { | |
| return self.url() + '/categories'; | |
| }; | |
| self.set({ |
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
| //gets value if field exists, and returns empty string otherwise | |
| Backbone.Model.prototype.getValue = function(field) { | |
| if (this.attributes[field] != undefined) { | |
| return this.attributes[field]; | |
| } | |
| else { | |
| return ''; | |
| } | |
| }; |
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
| // usage: ifDefined("field1.field2.field3") - do not specify second argument | |
| ifDefined: function(str_object, prev_eval) { | |
| var i = str_object.indexOf('.'); | |
| if (i === -1) { | |
| return true; | |
| } else { | |
| var first = str_object.substring(0,i), | |
| last = str_object.substring(i+1), | |
| j = last.indexOf('.'), | |
| second = last; |
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
| // | |
| // Backbone.Rails.js | |
| // | |
| // Makes Backbone.js play nicely with the default Rails setup, i.e., | |
| // no need to set | |
| // ActiveRecord::Base.include_root_in_json = false | |
| // and build all of your models directly from `params` rather than | |
| // `params[:model]`. | |
| // | |
| // Load this file after backbone.js and before your application JS. |