title: Rails - Helper Singleton and Rails Route Helpers in a Presenter
body: <p>I can't seem to figure out why I'm getting a 500 Error when trying to utilize a route helper in my Presenter class</p>
  
  <p>Have a Presenter class under 
  /apps/presenters/base_presenter.rb
  /apps/presenters/object_presenter.rb</p>
  
  <pre><code>class BasePresenter
  
    def self.as_collection(collection)
      collection.collect{|object| self.new(object)}
    end
  
    def help
      Helper.instance
    end
  
    class Helper
      include Singleton
      include Rails.application.routes.url_helpers
      include ActionView::Helpers::TextHelper
      include ActionView::Helpers::TagHelper
      include ActionView::Helpers::UrlHelper
      include ApplicationHelper
      include UrlHelper
    end
  
  end
  </code></pre>
  
  <p>so in my object presenter I do the following for an as_json.  Every thing works until I add this url. Boggled as to why it won't access the Rails routes.</p>
  
  <pre><code>class ObjectPresenter &lt; BasePresenter
  
  
    def initialize( object )
      @object = object
    end
  
    def as_json(*args)
      { 
          :url =&gt; blah_blah_url(@object, :subdomain =&gt; "www")
      }
    end
  
  end
  </code></pre>
  
  <p>any help would be much appreciated because I'm stumped :)</p>