RubyMine显示警告’找不到’before_action“’

栏目: Ruby · 发布时间: 6年前

内容简介:当我从现有源导入项目并且没有为项目正确设置Project SDK时,我得到了同样的错误.翻译自:https://stackoverflow.com/questions/27575293/rubymine-shows-alert-cannot-find-before-action

RubyMine7.0.1在每个控制器类中显示此警报.

下面的控制器类文件.

谢谢.

application_controller.rb

class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception
  helper_method :current_user, :logged_in?
  before_action :authenticate

  private
  def current_user
    return unless sessions[:user_id]
    @current_user ||= User.find(session[:user_id])
  end

  def logged_in?
    !!session[:user_id]
  end

  def authenticate
    return if logged_in?
    redirect_to root_path, alert: 'ログインして下さい.'
  end
end

当我从现有源导入项目并且没有为项目正确设置Project SDK时,我得到了同样的错误.

翻译自:https://stackoverflow.com/questions/27575293/rubymine-shows-alert-cannot-find-before-action


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

亮剑.NET

亮剑.NET

2009-3 / 55.00元

《亮剑.NET:SharePoint Server 2007开发实战》共分为8章,详细讲解了SharePoint上常见的开发任务,讲述了各种开发场景下需要了解的知识,并提供了丰富的实例。《亮剑.NET:SharePoint Server 2007开发实战》第1章为基础知识,讲述SharePoint的基本概念,基本的对象模型,代码编写注意事项,并讲解了一个集开发和部署打包为一体的项目结构的创建;第2......一起来看看 《亮剑.NET》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具