Ruby on Rails
Saturday, January 16, 2016
Hello,
-- I've followed DHH's ActionCable chat demo (https://medium.com/@dhh/rails-5-action-cable-demo-8bba4ccfc55e#.720wf5ko0), and it works perfectly with this simple setup.
So logically the next step is adding user registration to the app and writing the user name in front of the message that has been posted.
Once I add a User model and Devise to my application, I get a bit lost. What I'd like to accomplish is having a user log through the Devise users/sign_in page, and identifying the "current_user" inside the MessageBroadcastJob.
I've already tried an uglier way (transmitting user.id through a cookie) but the valued is encrypted.
What would be the best way to get this information ?
Thanks for your help !
Cyril
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAD6x%3DibRE4aTvW%2BdHnSh4nREF3qS15V_K7rVyeMC5XzXfcG3hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment