Need to add a header to an ActiveResource request? If you need to do it at dynamically at request-time, redefine
I needed to include header in my requests, but I didn’t just want to set it in the class definition.
1 2 3
So, I overwrote
.headers to be a method rather than just a pointer to a hash:
1 2 3 4 5 6 7 8 9 10
Now, I can add whatever value to the headers I want, whenever I want!