Rails skip before action doesn't work
ruby-on-rails
Solution
This sounds normal to me - you've asked rails to skip your before action, except if the action is `:landing`, `:connect` or `:create` whereas it sounds as though you want the opposite. If you want those 3 actions not to execute the `require_login` then you should be doing
skip_before_action :require_login, :only => [:landing, :connect, :create]
Problem
i've some problem with the skip_before action: ``` class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :require_login before_action :inc_cookies def inc_cookies if cookies[:token] != nil @name = cookies[:name] @surname = cookies[:surname] @user_roomate = cookies[:roomate] end end def require_login if cookies[:token] == nil puts "No token" redirect_to '/' end end end ``` and my other controller: ``` class UsersController < ApplicationController skip_before_action :require_login, :except => [:landing, :connect, :create] end ``` I don't know why, but when I'm on the root (the :landing action from UsersController), Rails try to pass in the require_login... I've misundertood something with this filter, or do I something wrong? Thanks for any help!