【问题标题】:How to use restful_authentication for nested resources in Rails 2.3.8?如何在 Rails 2.3.8 中对嵌套资源使用 restful_authentication?
【发布时间】:2011-03-31 11:49:46
【问题描述】:

我有一个嵌套资源hotel_user,我希望在酒店命名空间下拥有hotel_users_controller。

我想在这里使用 RESTful 身份验证,并且我希望酒店目录中的hotel_users_controller、sessions_controller 像hotel/hotel_users_controller 和hotel/sessions_controller。我在终端中尝试了以下命令,但失败了。

script/generate authenticated hotel_user hotel/session 

它因错误而失败

 The name 'AuthenticatedSystem' is either already used in your application or reserved by Ruby on Rails.
  Please choose an alternative and run this generator again.

authenticated_system.rb 文件存在于 lib 目录下的某些其他资源,而不是 hotel_user。生成器看到它并且无法生成文件。我能做些什么?请帮忙

【问题讨论】:

  • FWIW,我的 Ruby 和 Rails 朋友告诉我“没有人再使用 restful-authentication”,而是使用更新的插件,如 Authlogic、cancan 等。

标签: ruby-on-rails restful-authentication


【解决方案1】:

更改您的文件名和模块名称。

重新生成您的 restful_authentication 并将其更改为其他名称。或者你以前的文件。

【讨论】:

  • 谢谢,我将按照评论者对上述问题的建议使用 authlogic
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-05
相关资源
最近更新 更多