开发者

Ruby on Rails: where is init.rb file?

开发者 https://www.devze.com 2023-03-25 05:53 出处:网络
I am new to rails.I am building my first application. I have to put the following lines in init.rb file:

I am new to rails.I am building my first application. I have to put the following lines in init.rb file:

#in init.rb
require ‘active_record’
require ‘simple_search’
ActiveRecord::Base.send(:extend, SimpleSearch::开发者_如何转开发ClassMethods)

could you tell me what is the location of init.rb file.


You need to the add the above lines to vendor/plugins/simply_searchable/init.rb

https://gist.github.com/362823

Restart the server for the changes to take effect.


You can put it in config/environment/init.rb or config/initializers/init.rb

0

精彩评论

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