我有一些麻煩讓ActiveAdmin與CanCanCan一起使用。我在Rails 4應用程序中使用CanCanCan版本1.9.2和ActiveAdmin版本1.0.0.pre。建立自己的能力一流,並通過添加load_and_authorize_resource和check_authorization我的ApplicationController使我的應用程序的其餘部分授權檢查後,我得到的錯誤 p
我已經在Nitrous.io上創建了一個使用Active Admin的導軌應用程序,並且所有工作都在該開發環境中工作。我使用設計/ CanCanCan認證/授權 當我推到Heroku的,並嘗試訪問主動聯繫,我得到以下錯誤: Started GET "/admin" for 91.226.23.198 at 2014-09-06 21:15:49 +0000
我有這個在我看來: <% if user_signed_in? && current_user.has_role? :admin or :editor %>
這將返回該錯誤: syntax error, unexpected tSYMBEG, expecting keyword_then or ';' or '\n'
我也試過這樣: <% if user_signed_in? and cu
我正在使用Devise進行身份驗證,並且cancancan進行授權。現在,我希望不允許某些頁面的視圖用戶。所以我添加下面的代碼。但是它會爲#錯誤拋出未定義的局部變量或方法`current_user'。 我ability.rb class Ability
include CanCan::Ability
def initialize(dashboard_user)