Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:52:41+00:00 2026-06-10T02:52:41+00:00

Devise (2.1) was using my custom views fine until I told it to use

  • 0

Devise (2.1) was using my custom views fine until I told it to use a custom controller. Now it ignores my custom views.

Previously everything worked fine:

Tell Devise to use custom views in /config/devise.rb

# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
config.scoped_views = true

Add custom view: /app/views/subscribers/session/new.html.erb

Set up routes in /config/routes.rb

devise_for :subscribers

Then I added a custom SubscriberSessionsController as /app/controllers/subscriber_session_controller.rb

class SubscriberSessionsController < Devise::SessionsController

    before_filter :isInIframe

    private

        def isInIframe
            @hide_navbar = session[:in_iframe]
        end

end

And modified /config/routes.rb to tell Devise to use this new controller instead of its default:

devise_for :subscribers, :controllers => { 
    :sessions => "subscriber_sessions"
  }

Once I restart my server, Devise now uses this controller but ignores my custom view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:52:43+00:00Added an answer on June 10, 2026 at 2:52 am

    As is so often the case, ten minutes after posting the question I cracked it.

    The reason Devise wasn’t finding the view was it was looking for it in a different folder.My replacement controller was called subscriber_sessions.rbso devise was no longer looking in views/subscribers/sessions but views/subscribers/subscriber_sessions.

    I solved this problem with the following:

    Changed my subscriber routes to:

      devise_for :subscribers, :controllers => { 
        :sessions => "subscribers/sessions"
      }
    

    Renamed my subscriber_sessions controller to just sessions and moved it into a subscribers folder so its new name & location are: app/controllers/subscribers/sessions_controller.rb

    I also had to add a namespace to the class so the new sessions_controller.rb file looks like this”

    class Subscribers::SessionsController < Devise::SessionsController
    
        before_filter :isInIframe
    
        private
    
            def isInIframe
                @hide_navbar = session[:in_iframe]
            end
    
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So everything was running fine with my app on heroku. I installed the devise
Using Devise, I know how to protect controller actions from non-signed-in users through: before_filter
I'd like to recreate the CheckedTextView's functionality using my own custom views so I
I'm using Devise for authentication with two custom fields added = :organization_id and :username
I'm using Rails 3, with devise and have generated the devise views. Recently I've
using devise 2.1.0 I had to override the devise registration controller. In the process
I'm creating an iOS application with lots of custom views, so, using default Cocoa
I am using both the Mobile Device Browser File and a custom .browser file.
I’m interested in using libhid to access a custom HID device that we are
Using devise 2.1.0 I am trying to send the new registration page a PricingPlan

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.