0

I'm trying to use Devise and HighVoltage on a very simple test project. On development runnign rails server HighVoltage works fine, but, on a remote server runing in production using passenger going to the same url redirects to the login screen.

This is the code:

class ApplicationController < ActionController::Base
  before_action :authenticate_user!, except: ['home']


class PagesController < HighVoltage::PagesController
    skip_filter :authenticate_user!

I, [2015-11-10T23:57:21.491566 #27644]  INFO -- : Processing by HighVoltage::PagesController#show as HTML
I, [2015-11-10T23:57:21.491656 #27644]  INFO -- :   Parameters: {"id"=>"testpage"}
I, [2015-11-10T23:57:21.500450 #27644]  INFO -- : Completed 401 Unauthorized in 9ms (ActiveRecord: 0.0ms)

What could be the reason? there is no changes in code between one version an the other, also, gems are the same. I tested removing the before_action and it works fine. So it make me think that the problem is that the skip_filter method is not working.

Arnold Roa
  • 7,335
  • 5
  • 50
  • 69
  • 2
    check the controller inheritance. PagesController inherits from HighVoltage::PagesController. – jvnill Nov 11 '15 at 06:33
  • What I should check there? in development it works, I also checked if my controller was being loaded adding a `puts "testing"` inside the class, and it got printed on the passanger server start command, my guess was that the skip filter was not being called on production for some reason, but i'm out of clues now. – Arnold Roa Nov 11 '15 at 13:00
  • first, try changing skip_filter to skip_before_action. see if that works. – jvnill Nov 11 '15 at 21:06

0 Answers0