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

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

内容简介:当我从现有源导入项目并且没有为项目正确设置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


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

查看所有标签

猜你喜欢:

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

Programming Python

Programming Python

Mark Lutz / O'Reilly Media / 2006-8-30 / USD 59.99

Already the industry standard for Python users, "Programming Python" from O'Reilly just got even better. This third edition has been updated to reflect current best practices and the abundance of chan......一起来看看 《Programming Python》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具