Sha256: 0db4f856ec6e5b5e6cc06f3a23c1ef66f8d7925fa9b28977618ebb3a2908b37c
Contents?: true
Size: 473 Bytes
Versions: 10
Compression:
Stored size: 473 Bytes
Contents
require 'core_ext/ruby/module/include_anonymous' module UrlHelper def self.included(base) base.send(:helper_method, public_instance_methods) end include do def public_url public_url_for(resources.reject { |r| r.respond_to?(:new_record?) && r.new_record? }) end def public_url_for(resources, options = {}) resources -= [:admin, site] resources.empty? ? "http://#{site.host}" : polymorphic_url(resources, options) end end end
Version data entries
10 entries across 10 versions & 1 rubygems