隐藏 html 元素
我试图隐藏视图中编辑和销毁操作的链接,除非用户已使用 http 基本身份验证登录。我已在下面附上我的文件。谢谢
查看https://gist.github.com/1272716 控制器 https://gist.github.com/1272712
I'm attempting to hide the links for edit and destroy actions in the view unless the user has logged in using http basic auth. I've attached my files below. Thanks
View https://gist.github.com/1272716
Controller https://gist.github.com/1272712
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要保存/存储身份验证结果,然后在视图中有条件地呈现。
控制器:
视图:
You need to save/store the authenticate result, and then render conditionally in your view.
Controller:
View: