Closed Tonkpils closed 11 years ago
Hi I am experiencing the same 'Nil is not a symbol' issue in development.
controller
def index
@person = current_user.person
respond_with(@person)
end
index.rabl
collection :@person
attributes :uid, :full_name, :gender, :mini_bio, :birthday => :dob
I have check the @person
variable and it is a full object. This was working with no problem yesterday and I cannot figure out where I am now going wrong. I have attempted to undo changes and get back to working version but no luck.
Type error on Line 18
also:
{LOCAL_PATH}/rabl-rails-0.3.0/lib/rabl-rails/library.rb:18:in `const_get'
@justmatt Can you double check your format parameter in your application. For some reason, my format was getting upcased somewhere along the request. I posted a fix for this #25
@Tonkpils Yea thanks, that fixed the problem! I left some comments on you code ( I can't be bothered to submit a pull request). Appreciate you taking the time to reply to me; wouldn't have got this without your encouragement
I ran into this issue when I went into production and tested in both small and big apps in development.
controller
index.json.rabl
I made a request a request to the list action and this was the output the first time. Server
Response
I made a second request to the same action and this was the output. Server
Any subsequent request returned the same error. I restarted the server and it allowed me to make one request with a successful response and rest became errors again.
The trace showed the error pointing to this line in rabl-rails
[PROJECT_ROOT]/vendor/cache/rabl-rails/lib/rabl-rails/library.rb, line 18