【发布时间】:2014-05-19 16:59:33
【问题描述】:
我有一个带有配置部分的页面,一些用户可以在其中编辑站点的元素和变量。 我想控制对页面的访问,但因为它不是模型,我不知道该怎么做。
我的控制器
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
我实际上不确定这个错误是什么意思。 这样做的正确方法是什么?
谢谢。
【问题讨论】:
标签: ruby-on-rails cancan