rendered paste bodyclass GatewaysController < ApplicationController #before_filter :admin_only, :only => [:update] # GET /gateways # GET /gateways.xml def index @gateways = Gateway.find(:all, :conditions => {:gw_attribute => "via", :reseller_id => @userinterface.device}, :select => "id, gw_username, gw_value") respond_to do |format| format.html # index.html.erb format.xml { render :xml => @gateways } end endend NoMethodError in GatewaysController#indexYou have a nil object when you didn't expect it!The error occurred while evaluating nil.deviceRAILS_ROOT: /Users/miles/Documents/Dev/gatewayApplication Trace | Framework Trace | Full Traceapp/controllers/gateways_controller.rb:7:in `index'