I’ve been trying to get Clearance and RailsAdmin working together, and in particular, I’m following this blog post from thoughtbot. Everything goes as the blog post describes until I get to the step about setting up the RailsAdmin initializer. Prior to this step, one of the two feature specs was passing, but once I create the initializer with the code provided, both tests fail. (The blog post indicates that they should both pass.)
The problem (which I admit sounds like something simple) is that when the initializer calls .admin? on current_user, it raises an error indicating that current_user is nil.
I’m not very familiar with either Clearance or RailsAdmin, and despite some digging around, I’ve not been able to determine what could be causing this.
So here’s some code:
- My demo app so far: https://github.com/joshukraine/clearance_admin
- Disclosure: I generated the app using my own Rails app template: https://github.com/joshukraine/eto-rails-template
- The output from my two failing specs is here: https://gist.github.com/joshukraine/b5daea439f27c8095f1d
If someone could point me in the right direction here I would be grateful. Also, if someone could provide a link to a sample Rails 4 app that integrates Clearance and RailsAdmin, that would be very helpful.