Sha256: e9d15d5f6e009df0cc02a037c8085521ec8d89733a07d6e28b2b964a4bd7d383

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

module Upholsterer
  class Railtie < Rails::Railtie
    config.upholsterer = ActiveSupport::OrderedOptions.new
  end

  class Base
    delegate :translate, :t, :localize, :l, :to => :helpers

    def self.routes_module
      @routes_module ||= Module.new do
        include Rails.application.routes.url_helpers
        include UrlMethods
      end
    end

    def self.routes
      @routes ||= Object.new.extend(routes_module)
    end

    def routes
      self.class.routes
    end
    alias_method :r, :routes

    def helpers
      @_helpers ||= ApplicationController.helpers
    end
    alias_method :h, :helpers
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
upholsterer-1.4.1 lib/upholsterer/rails.rb