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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -