[英]how to implement “has_messages_generator” on rails3 with devise?
I already created App that I would like to add "has_message_generator" into it. 我已经创建了要添加“ has_message_generator”的应用程序。 an auth plugin "Devise" is already installed,so that I followed these dierection below.
已经安装了auth插件“ Devise”,因此我在下面遵循了这些指导。
Add this line to my Gemfile and did bundle install gem "has_messages_generators"
将此行添加到我的Gemfile中,并捆绑安装
gem "has_messages_generators"
Did this command line and it seemed everything's ok! 做了这个命令行,似乎一切正常!
rails g has_messages:install user
But it shows "uninitialized constant User::HasMessages"
error when I access to root page. 但是当我访问根页面时,它显示
"uninitialized constant User::HasMessages"
错误。 so I took "include HasMessages"
off from user.rb(in Model directory) and did "bundle exec rake db:migrate"
It seemed it created table successfully. 所以我从user.rb(在Model目录中)中
"include HasMessages"
了"include HasMessages"
,并做了"include HasMessages"
"bundle exec rake db:migrate"
。看来它成功创建了表。
Then I tried to access to root page, it still shows error "undefined method
inbox' for #"` 然后我尝试访问根页面,它仍然显示错误
"undefined method
#的"undefined method
收件箱”。
Anyone has idea with the installation of this plugin??? 有人对安装此插件有想法吗???
You have to install has_messages , too: 您还必须安装has_messages :
… to use this you must include
devise
andhas_messages
in your Gemfile.......利用这一点,你必须包括
devise
和has_messages
在你的Gemfile。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.