Hi, I am developing a plugin for database search in rails 3. I have created a plugin with name "db_search". I have written following code in "/vendor/plugins/db_search/lib/db_search.rb" "require File.join(File.dirname(__FILE__), 'db_search/core')"
Then I have written following code in "vendor/plugins/db_search/lib/db_search/core.rb" "module TRG module DBSEARCH def with() p "I am in with" end end end"
To make my search independent of models I have created search.rb in the "/model". I have added following code:-
"class Search include TRG::DBSEARCH end"
I have user controller. I have written a following method into it:- def search Search.new end Whenever I am running this method I am getting an error:- "uninitialized constant Search::TRG"
I also Tried with "TRG::DBSEARCH.with()" but no luck
I don't know why my plugin modules are not get loaded. Can anyone tell me what is wrong with the code?