我有一个非常简单的 Rails 4.2.4 应用程序,没有或不需要用户。但是,我想用密码保护恰好是索引 View 的单个页面(管理页面)。有什么想法吗?
最佳答案
我将此行添加到 Controller 的顶部并且它有效:
http_basic_authenticate_with :name => "your_name", :password => "your_password", only: :index
关于ruby-on-rails-4 - 使用密码保护 Rails 中的单个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36236977/