How To Pass Devise User To AngularJS

Posted by Weston Ganger on July 07, 2015

I wanted to pass the current_user in devise to my angular app. I’m not sure that this is best practice but it works.

<% if current_user %>
    var current_user = <%= raw current_user.to_json  %>
<% end %>

Related External Links:

Posted in Angular and Tagged with angularjs rails devise 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts