Class: UniRateRails::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/unirate_rails/engine.rb

Overview

Isolated, mountable Rails engine. Wiring it up does three things:

  1. Namespaces the engine so its routes/controllers don't collide with the host app.
  2. Mixes Helper into every ActionView render, exposing the unirate_rate / unirate_convert view helpers.

Mount the JSON proxy controller from the host app's routes if you want a ready-made endpoint:

# config/routes.rb
mount UniRateRails::Engine => "/unirate"