Rails: url_for to be available in a isolated class that must be instanced

Posted by Totty on Stack Overflow See other posts from Stack Overflow or by Totty
Published on 2010-05-14T23:40:21Z Indexed on 2010/05/14 23:44 UTC
Read the original article Hit count: 209

Filed under:

Rails: url_for to be available in a isolated class that must be instanced:

                    class ProfilePresenter < ActionController::Base

attr_reader :profile


def initialize(profile)
    super


    @a = url_for(:controller => 'profiles', :action => 'view', :profile_url => 'dd')
    @a

    @profile = profile
        end
     end

How to make the url_for work? i tried to extend the ActionController::Base and the ActionView::Base and i cant :s

© Stack Overflow or respective owner

Related posts about rails