I recently took this, making the following changes, in addition to adding remote: true to the form:
config / Initializers / Develop
# If http headers should be returned for AJAX requests. True by default. config.http_authenticatable_on_xhr = false
config /routes.rb
devise_for :users, controllers: { registrations: 'users/registrations' }
Controllers / Users / registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController respond_to :html, :js end
views / users / registration / create.js.erb
alert('success');
views / users / registration / new.js.erb
alert('invalid');
Brad werth
source share