Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DashboardController < ApplicationController
- before_filter :authorize
- def index
- @user = current_user
- end
- end
- dashboard.js.erb
- (function(jQuery){
- /*****************************
- * *
- * Model Section *
- * *
- *****************************/
- window.Navigation = Backbone.Model.extend({});
- window.navigation = new window.Navigation({
- activebutton: 'Reports',
- // This is the offending line
- properties: <%= @user.properties.map {|p| {name: p.name, id: p.id}}.to_json %>
- });
- The Error
- NoMethodError in Dashboard#index
- Showing /Users/jkay/Sites/owner_portal/app/views/layouts/application.html.erb where line #6 raised:
- undefined method `properties' for nil:NilClass
- (in /Users/jkay/Sites/owner_portal/app/assets/javascripts/dashboard.js.erb)
Add Comment
Please, Sign In to add comment