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:

rails api responder

asciicast


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -