内容简介:当我从现有源导入项目并且没有为项目正确设置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
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- c – 我可以在不禁用“将警告视为错误”的情况下排除某些特定警告吗?
- PHP警告:除以零
- iOS工程的警告修复
- 用了@Autowired注入,竟然被警告
- iOS去除Xcode代码警告
- PHP Session的一个警告
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
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》 这本书的介绍吧!