Getting a turbolinks shell to work with Ruby on Rails Devise

For my application, I am trying to configure Turbolinks Mobile wrapper>. I encounter a problem when I cannot enter the application (and I think that the problems are that I need to change Devise to make it switch to XHR to work on a mobile device). In my form sign_in, Devise is used, but I do not see the code.

Using: ruby "2.4.0" gem "rails", "5.0.2" gem "turbolinks", "~> 5.0.0.beta" gem "devise", ">= 4.2.0" gem "devise-async", git: "https://github.com/mhfs/devise-async", branch: "devise-4.x" # for user authentication

My question is where do I look or what do I need to do to make changes to DEVISE so that it can send XHR to the turbolinks mobile shell?

Right now, it won’t log in, and I know (or I think) I need to get DEVISE to switch to XHR, but I don’t know how to do it.

Suggestions on how to do this? Or recommendations for reference material?

+6
1

, ajax.

config.http_authenticatable_on_xhr = false
config.navigational_formats = ["*/*", :html, :json]

, , , json.

format.json { render json: resource }
+2

Source: https://habr.com/ru/post/1015833/


All Articles