2

I am working on a Rails 5 API only app using JWT tokens.

I'd like to use Rails Admin for internal processes and would like to configure Devise (or Clearance) for auth for staff members instead of integrating JWT tokens with Rails Admin directly.

The problem I have is once I set up Devise or Clearance (the controllers, models, and routes are there) the sign in screens return an empty HTML page.

There are some related issues with Clearance mentioned in https://github.com/thoughtbot/clearance/issues/741 but I've been unable to figure out why the HTML does not load.

The Rails API does exclude some middleware but it's not clear to me which is missing or causing the issue. Thanks.

srt32
  • 1,260
  • 1
  • 14
  • 27

2 Answers2

0

I solved the problem by converting the Rails API only app to be a normal Rails app. Not the best solution, in my opinion, but it works!

srt32
  • 1,260
  • 1
  • 14
  • 27
  • 1
    How did you converted Rails API app to normal Rails app??, is there any plugin or script available ?? – Mani David Jul 10 '17 at 13:22
  • https://stackoverflow.com/questions/36669981/how-do-you-convert-a-rails-5-api-app-to-a-rails-app-that-can-act-as-both-api-and#36670987 Should get you most of the way there – srt32 Jul 10 '17 at 16:49
0

I had the same problem here. I solved by doing:

config/application.rb

config.api_only = false

And check your app/views/layouts/application.html.erb

Make sure that you have <%= yield %> somewhere inside your html