Sha256: e8425b699ceaf0e77cdf08e24aa6a5f84cd5062eaae2a726fa765a968fdb9ac3

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

module Bodega
  module ApplicationHelper
    def self.included(base)
      base.class_eval do
        alias :method_missing_without_bodega :method_missing
        alias :method_missing :method_missing_with_bodega
      end
    end
    protected
    def method_missing_with_bodega(method_name, *args)
      if method_name.to_s =~ /.+_(url|path)$/ && main_app.respond_to?(method_name)
        return main_app.send(method_name, *args)
      end
      method_missing_without_bodega method_name, *args
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bodega-0.3.0 app/helpers/bodega/application_helper.rb