Hi,
I'm upgrading an app to 2.3 and can't figure out how to resolve this issue:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1560
In earlier versions (I'm coming from 2.1) link_to did this:
url = case options when String options when :back @controller.request.env["HTTP_REFERER"] || 'javascript:history.back ()' else self.url_for(options) end
whereas now it just does a unconditional
url = url_for(options)
If you include
ActionController::UrlWriter
somewhere and do a link_to with a named route you get the nice "TypeError: can't convert String into Hash" exception, because url_for in UrlWriter doesn't know how to handle Strings.
Would love to work on a patch, but I have no idea how this is supposed to work:
* just change the link_to implementation? * change UrlWriter#url_for to handle Strings as options? * am I doing something wrong?
thanks, Florian