I added functions like

def myusertype_photo_url(a,b,args={}); user_photo_url(a,b,args); end

to my version of the BaseController, and even the BaseHelper, hoping
for an Engines
mix in.

Funny thing, it works perfectly in the development environment, but
doesn't work on the
production system.

Is there a strange reason for this?

I do have access to any functions I "mix-in" to the BaseController and
BaseHelper, but polymorphic_url
doesn't seem to be picking this up in the production environment.

Any clues?

Thanks,
-Polar

On Apr 7, 12:08 pm, moritz <a5s...@yahoo.com> wrote:
> Great!  This is exactly what I was looking for.  Thank you.
>
> On Apr 7, 7:25 am, Bruno Bornsztein <bruno.bornszt...@gmail.com>
> wrote:
>
> > Hmmm... basically you're talking about subclassing routes, or at least
> > aliasing them (so that myusertype_photo_url is the same as user_photo_url).
> > Looks like there's a ticket (http://dev.rubyonrails.org/ticket/10454) with
> > some ideas on how to fix it. In particular, you could override the
> > polymorphic_url method to check for a superclass before generating the
> > route.
>
> > On Thu, Apr 2, 2009 at 6:50 PM, moritz <a5s...@yahoo.com> wrote:
>
> > > The following stack trace
>
> > > NoMethodError (undefined method `my_user_type_photo_url' for
> > > #<UserNotifier:0x3cbd560>):
> > >    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
> > > polymorphic_routes.rb:112:in `__send__'
> > >    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/
> > > polymorphic_routes.rb:112:in `polymorphic_url'
> > >    /app/helpers/base_helper.rb:8:in `commentable_url'
> > >    /vendor/plugins/community_engine/app/models/user_notifier.rb:37:in
> > > `comment_notice'
> > >    /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
> > > base.rb:462:in `__send__'
> > >    /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
> > > base.rb:462:in `create!'
> > >    /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
> > > base.rb:455:in `initialize'
> > >    /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
> > > base.rb:392:in `new'
> > >    /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
> > > base.rb:392:in `method_missing'
> > >    /vendor/plugins/community_engine/app/models/comment.rb:109:in
> > > `send_notifications'
> > >    /app/controllers/comments_controller.rb:156:in `create'
>
> > > made me think that I could implement a method
>
> > >  def my_user_type_photo_url(user, options)
> > >    user_photo_url(user, options)
> > >  end
>
> > > I tried it by adding it to base_helper.rb and it works for this case.
>
> > > Is there a better place to handle this?
>
> > > Is there a way to automate it, maybe?
>
> > > How can it be extended beyond photos?
>
> > > I'm still hoping for suggestions to improve the way this is handled.
>
> > > Thanks in advance for your suggestions.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to communityengine@googlegroups.com
To unsubscribe from this group, send email to 
communityengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to