javascript - Devise Registration#update via JS in Rails -
i'm trying update user model through devise ajax , have devise respond proper javascript file.
i want submit form remotely registrations#update action, isn't working default response devise, uses following registrationscontroller:
respond_with resource, :location => after_update_path_for(resource)
the above tries redirect default route instead of rendering update.js.erb file. able overwrite action , have work following change:
respond_to |format| format.html format.js end
but, seems brute force i'm overriding entire action. there simple way devise know respond javascript instead of doing default redirect?
simply had add line registrationscontroller devise knows respond_to both html , js.
class registrationscontroller < devise::registrationscontroller respond_to :html, :js end
reading on how respond_with helped. couple of links:
Comments
Post a Comment