Sha256: cbbb8a7afc7a34215b6762cd5dfa7b5fc3cb0e90f8076d60ba644e8576e6a3fa

Contents?: true

Size: 614 Bytes

Versions: 13

Compression:

Stored size: 614 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
      ApplicationController.helpers
    end
    alias_method :h, :helpers
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
upholsterer-1.4.0 lib/upholsterer/rails.rb
upholsterer-1.3.0 lib/upholsterer/rails.rb
upholsterer-1.2.0 lib/upholsterer/rails.rb
upholsterer-1.1.0 lib/upholsterer/rails.rb
upholsterer-1.0.0 lib/upholsterer/rails.rb
upholsterer-0.5.0 lib/upholsterer/rails.rb
upholsterer-0.4.5 lib/upholsterer/rails.rb
upholsterer-0.4.4 lib/upholsterer/rails.rb
upholsterer-0.4.3 lib/upholsterer/rails.rb
upholsterer-0.4.2 lib/upholsterer/rails.rb
upholsterer-0.4.1 lib/upholsterer/rails.rb
upholsterer-0.4.0 lib/upholsterer/rails.rb
upholsterer-0.3.1 lib/upholsterer/rails.rb