Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Can't find correct path to scoped views #654

Closed
yfeldblum opened this Issue · 3 comments

3 participants

@yfeldblum

I have

# config/initializers/devise.rb
config.scoped_views = true

# config/routes.rb
namespace :actors do
  devise_for :account, :class_name => 'Actor', :module => 'devise'
end

I have the installed devise views in the directory app/views/actors/account/. However, Devise does not find these views. When I move them to the directory app/views/actors_account/ then Devise finds these views.

The problem is that Devise::Controllers::ScopedViews#render_with_scope tries first with devise_mapping.plural, which returns :actors_account. I would expect Devise to try first with 'actors/account' rather than :actors_account, because I would expect to the views to belong in app/views/actors/account.

Cheers

@josevalim
Owner

Ensure namespaces has proper scoped views, closed by d8016ea

@yfeldblum

Thank you Jose!

@pch

Has this change been reverted since then? I'm still having this issue with the following routes:

  namespace :customer do
    devise_for :customer_users, :module => 'devise'
  end

Devise looks for templates in app/views/customer_customer_users rather than in app/view/customer/customer_users.

I've solved this temporarily with this monkeypatch https://gist.github.com/837658 (changed devise_mapping.plural to devise_mapping.fullpath).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.