plataformatec/devise — pull request #3171 by micat (2014-08-24 12:44:29+00:00)
Title: Url helpers raise "undefined method `router_name' for nil:NilClass"

When I update devise from 3.2.4 to 3.3.0, url helpers with string raises an Exception, although the comment for [UrlHelpers](/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.rb) says it can receive string.

~~~
<%= link_to new_session_path(:user), "Sign in" %> # OK
<%= link_to new_session_path("user"), "Sign in" %> # => undefined method `router_name' for nil:NilClass
~~~

It seems to be a bug which Devise::Mapping.find_scope! returns String instead of Symbol and can not find the value in Devise.mappings hash. But it may be better to change Devise.Mappings to `ActiveSupport::HashWithIndifferentAccess`.

Anyway, here is a pull request to fix the find_scope! method.