开发者

What code runs when a Rails application is started?

is there an event I can write some code for when a Rails appli开发者_C百科cation is first started? I want to make sure my administrator user exists whenever the app starts. I am using devise auth framework in case that helps.


It would be better to make a new user in seeds.rb and run rake db:seed before starting the application - that's what it's for.


You could probably make an initializer inside of config/initializers. You have to make sure you load up devise first, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜