Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无模型控制器上的Cancan_Ruby On Rails_Cancan - Fatal编程技术网

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