How To Pass Devise User To AngularJS

Posted by Weston Ganger

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:

Article Topic:Software Development - Angular

Date:July 07, 2015

Recommended Posts



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected