2014-05-19 36 views
0

我有一個配置部分,其中一些用戶可以編輯網站的元素和變量。 我希望能夠控制對頁面的訪問,但因爲它不是模型,所以我不知道該怎麼做。Cancan在無模型控制器上

我控制器

class ConfigurationController < ApplicationController 
    def index 
    end 
end 

我的菜單

<% if can?(:read, Configuration) # not sure of that %> 
    <li><%= link_to t('texts.configuration.title'), configuration_index_path %></li> 
<% end %> 

我有這個代碼錯誤:

uninitialized constant ActionView::CompiledTemplates::Configuration 

我actualy不知道是什麼意思這個錯誤。 什麼是正確的方法來做到這一點?

謝謝。

回答