vendredi 7 août 2015

Rails / Devise: Namespaced RegistrationsController fetching non-namespaced views

I have a Rails 4 / Devise 3 app. I have a base set of routes and view files that is pretty standard. I then have a namespaced portals set of views and routes that are only hit when a user access the site through a subdomain.

How do I tell me namespaced Portals::RegistrationsController to get the Devise views from app/views/portals/devise rather than app/views/devise?

Here is my controller:

class Portals::RegistrationsController < RegistrationsController
    layout 'portals/layouts/application'
    append_view_path 'portals'

    def create
        @portal = Portal.friendly.find(request.subdomain)
        super
    end

    def edit
        @portal = Portal.friendly.find(request.subdomain)
        super
    end

    def update
    end
end

I tried using append_view_path 'portals' but that seemed to have no effect. All my other non-devise controllers grab the right view files by default.

Aucun commentaire:

Enregistrer un commentaire