[英]How can I add a video using the video_tag helper on my sign_in devise page?
[英]Using Devise, how can I set the root page to not redirect to the “sign_in” page if the user is logged out?
我想用数据库中的某些项目填充根页面,并且只有链接可以登录页面上的某处。 基本上,我不想让登录用户独享该内容。
在您的根控制器中,只需添加:
skip_before_filter :authenticate_user!
例:
class RootController < ApplicationController
skip_before_filter :authenticate_user!
def index
#some logic here
end
end
您还可以将其限制为仅索引操作:
skip_before_filter :authenticate_user!, only: [:index]
祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.