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


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

查看所有标签

猜你喜欢:

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

RESTful Web Services Cookbook

RESTful Web Services Cookbook

Subbu Allamaraju / Yahoo Press / 2010-3-11 / USD 39.99

While the REST design philosophy has captured the imagination of web and enterprise developers alike, using this approach to develop real web services is no picnic. This cookbook includes more than 10......一起来看看 《RESTful Web Services Cookbook》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具