Ruby on rails 无模型控制器上的Cancan
我有一个带有配置部分的页面,其中一些用户可以编辑站点的元素和变量。 我想控制对页面的访问,但因为它不是一个模型,我不知道该怎么做 我的控制器Ruby on rails 无模型控制器上的Cancan,ruby-on-rails,cancan,Ruby On Rails,Cancan,我有一个带有配置部分的页面,其中一些用户可以编辑站点的元素和变量。 我想控制对页面的访问,但因为它不是一个模型,我不知道该怎么做 我的控制器 class ConfigurationController < ApplicationController def index end end 实际上我不确定这个错误是什么意思。 正确的方法是什么 谢谢。这是可能的,请跟随Github上的这篇文章,描述您的问题和解决方法: 还有: <% if can?(:read, Configu
class ConfigurationController < ApplicationController
def index
end
end
实际上我不确定这个错误是什么意思。
正确的方法是什么
谢谢。这是可能的,请跟随Github上的这篇文章,描述您的问题和解决方法: 还有:
<% 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