ruby - How do I include a class from lib folder in Rails 4 -
This class is in my Libs folder
About class I httparty base_uri 'api About.me 'def initialize (email) @options = {: query = & gt; {: Email = & gt; Service, extended = & gt; I have a model ActiveRecord :: Base Def some_method End End How do I use that model in my model?
You only need a special class in your model.
For example: Add the following line to the top of your model record requires 'about_me' Alternatively, you can do all in your application.rb config.autoload_paths + = Dir ["# {config.root}" Click the autoload lib / folder. / Lib / ** / "] along with the subdirectory
Comments
Post a Comment