Issues with JQuery AtWho
Hello, I enjoyed your screencast on implementing the @ functionality for user interactions. What I'm trying to figure out is how to handle the index.json.jbuilder when using devise
jQuery ->
$('[data-behavior ="autocomplete"]').atwho(
at: "@",
'data': "/users.json"
)
I cannot access the /users.json url with this approach. I created a separate UsersController for building profiles and displaying them. Otherwise, I'm puzzled on how I would get atWho to play nicely with Devise. I have a friendly_id slug for the username as well.
Hey Darion, sorry for the late reply! Got distracted with the holidays. :)
Devise overrides some of the URLs for /users like you mentioned (I think they do everything except index and show). You could just add the resources :users
route because I believe Devise does not make a GET /users route so it would match with your resources and controller. You should be safe here as long as you're
The other option would be to namespace that route with something like /api/users
which would be a way for you to separate out the two. It doesn't make for usable URLs in your app, but it might be a nice way to dedicate a controller entirely to the atwho behavior.
Alright, I will use the first method of adding resources for the users_controller.rb. I'll post an update to let you know how everything goes. I'm working on a feature implementation as we speak. Thank you.