apotonick / apotomo

MVC Components for Rails.
http://apotomo.de
654 stars 68 forks source link

arguments passed to url_for can't be handled (Rails 4 upgrade) #131

Closed alanq closed 10 years ago

alanq commented 10 years ago

This error is thrown on every call to url_for_event or to any path helper from within a widget. (I have "include ActionView::Helpers::UrlHelper", but same without).

My widgets are in engines.

arguments passed to url_for can't be handled. Please require routes or provide your own implementation

apotonick commented 10 years ago

This is because the UrlHelper in Rails 4 got changed (in a stupid way). I am in the process of changing this in the core itself.

alanq commented 10 years ago

Ok good stuff On 16 Oct 2013 01:39, "Nick Sutterer" notifications@github.com wrote:

This is because the UrlHelper in Rails 4 got changed (in a stupid way). I am in the process of changing this in the core itself.

— Reply to this email directly or view it on GitHubhttps://github.com/apotonick/apotomo/issues/131#issuecomment-26384653 .

alanq commented 10 years ago

Calling url_for on Apotomo::Widget from a child widget fixed this for me.

class MyParentWidget < Apotomo::Widget def url_for(options) self.parent.url_for(options) end