I have a request spec in a Rails engine. The view that is rendered calls a route and passes in a hash, i.e. projects_path(:scope => \"user\")
. A route like t
I had the same issue when updating to Rails 4, and I discovered that the problem was a model containing the following line:
include Rails.application.routes.url_helpers
Try finding code in your application that includes url_helpers
somewhere. Removing that line should help solve the problem.
include ActionView::Helpers::UrlHelper -> In my case, this was the line that i had to search and comment.
It looks to me like the problem is that include ActionView::Helpers
and include Rails.application.routes.url_helpers
conflict with each other.
I've found that if you put ActionView::Helpers
first it doesn't raise the error. So change
include Rails.application.routes.url_helpers
include ActionView::Helpers
to
include ActionView::Helpers
include Rails.application.routes.url_helpers
For me, the issue was caused by passing a hash as the second argument of a link_to line.
<%= link_to('click me', {one: params[:one], two: params[:two]}) %>
wrapping the hash in the actual path method for the page fixed the issue
<%= link_to('click me', actual_path({one: params[:one], two: params[:two]})) %>