开发者

What code runs when a Rails application is started?

开发者 https://www.devze.com 2023-03-18 18:22 出处:网络
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 fram

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

精彩评论

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