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 7872821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:19:35+00:00 2026-06-03T02:19:35+00:00

I integrate Devise to my app and here my current codes that I see

  • 0

I integrate Devise to my app and here my current codes that I see important for the problem.

here is the my sign out link

<nav class="round">
        <ul>
            <li>
                <%= link_to "Home", root_path%>
            </li>
            <li>
                <%= link_to "Help (learn Bunch-It)", help_path %>
            </li>
            <% if signed_in? %>
            <li>
                <%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
            </li>
            <li>
                <%= link_to "Profile "+current_user.user_name, user_path(current_user), :method => :delete %>
            </li>
            <%else%>
            <li>
                <%= link_to "Sign in", new_user_session_path %>
            </li>
            <%end%>
        </ul>
    </nav>

then route.rb

devise_for :users

  #get "sessions/new"

  #get "session/new"

  resources :users
  #resources :sessions, :only => [:new, :create, :destroy]

  #get "users/new"

  get "pages/home"

  get "pages/contact"

  get "pages/about"

  get "pages/help"

  get "results/result"

  get 'tree/insertResult' => 'tree#insertResult'

  get "tree/deleteFolder" => 'tree#deleteFolder'

  get "tree/createFolder" => 'tree#createFolder'

  get "tree/deleteResult" => 'tree#deleteResult'

  match '/results' , :to => 'results#result'
  match '/contact' , :to => 'pages#contact'
  match '/about' , :to => 'pages#about'
  match '/help' , :to => 'pages#help'
  match '/home_index', :to => 'pages#home'
  #match '/signin', :to => 'sessions#new'
  #match '/signout', :to => 'sessions#destroy'
  root :to => 'pages#home'

here is my controller func. for home page

class PagesController < ApplicationController

  def home
    @title = "Home"
    session[:return_to] = request.fullpath
    @page = request.path
    puts "Welcome home page"
  end
...

and finally here is my profile site controller

class UsersController < ApplicationController
  before_filter :authenticate_user!, :only => :token

  def index

  end
  def token

  end
  def show
    @title = current_user.user_name
    @haveQuery = false
    if @newest_query = findNewestQuery
      @common_query = commonQuery
      @haveQuery = true
    else
      @haveQuery = false
    end
  end

The problem is, when I press sign out my app just refresh the profile site or direct me to the profile site, if I am on different site currently. However I want to be directed to the home page of my app instead of profile page. I did whatever I can think of but cannot solve. Any little idea is like a present for me ? 🙂

  • 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-03T02:19:36+00:00Added an answer on June 3, 2026 at 2:19 am

    I had this same problem with my rails 3.2 app. I found that the problem was with my route file. If you are still having trouble with it I would recommend opening the devise gem and poking around.

      devise_for :users, :controllers => {:sessions => "user/sessions", :registrations => "user/registrations"}
      devise_scope :user do
        get '/login' => 'devise/sessions#new'
        get '/logout' => 'devise/sessions#destroy'
      end
      resources :user, :controller => "user"
      root :to => "home#index"
    

    And in the view some thing like this

    <%= link_to 'Logout', logout_path, :method => :delete %>
    

    And the users model would look like this

        class User
          # Include default devise modules. Others available are:
          # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
          devise :database_authenticatable, :registerable,
                 :recoverable, :rememberable, :trackable, :validatable
    
          # Validations.
          validates_presence_of :email, :first_name, :last_name, :password
          validates_uniqueness_of :email, :case_sensitive => false
          attr_accessible :first_name, :last_name, :email, :password, :password_confirmation, :remember_me
    
    
         end
    

    EDIT:
    Great way to check that stuff out

    $ rake routes
    DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from <top (required)> at /Users/telmate/Documents/tmp_H/hucker/config/application.rb:20)
    MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps.
    MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
            new_user_session GET    /users/sign_in(.:format)       user/sessions#new
                user_session POST   /users/sign_in(.:format)       user/sessions#create
        destroy_user_session DELETE /users/sign_out(.:format)      user/sessions#destroy
               user_password POST   /users/password(.:format)      devise/passwords#create
           new_user_password GET    /users/password/new(.:format)  devise/passwords#new
          edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                             PUT    /users/password(.:format)      devise/passwords#update
    cancel_user_registration GET    /users/cancel(.:format)        user/registrations#cancel
           user_registration POST   /users(.:format)               user/registrations#create
       new_user_registration GET    /users/sign_up(.:format)       user/registrations#new
      edit_user_registration GET    /users/edit(.:format)          user/registrations#edit
                             PUT    /users(.:format)               user/registrations#update
                             DELETE /users(.:format)               user/registrations#destroy
                       login GET    /login(.:format)               devise/sessions#new
                      logout GET    /logout(.:format)              devise/sessions#destroy
                  user_index GET    /user(.:format)                user#index
                             POST   /user(.:format)                user#create
                    new_user GET    /user/new(.:format)            user#new
                   edit_user GET    /user/:id/edit(.:format)       user#edit
                        user GET    /user/:id(.:format)            user#show
                             PUT    /user/:id(.:format)            user#update
                             DELETE /user/:id(.:format)            user#destroy
                        root        /                              home#index
    

    Also here are my controllers just so that we are mostly on the same page.

    class User::SessionsController < Devise::SessionsController
    
      def new
        super
      end
    
      def create
         resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new")
         if is_navigational_format?
           if resource.sign_in_count == 1
             set_flash_message(:notice, :signed_in_first_time)
           else
             set_flash_message(:notice, :signed_in)
           end
         end
         sign_in(resource_name, resource)
         respond_with resource, :location => redirect_location(resource_name, resource)
       end  
    end
    
    class User::RegistrationsController < Devise::RegistrationsController
    
      def new
          super # no customization, simply call the devise implementation
        end
    
        def create
          begin
            super # this calls Devise::RegistrationsController#create
          rescue MyApp::Error => e
            e.errors.each { |error| resource.errors.add :base, error }
            clean_up_passwords(resource)
            respond_with_navigational(resource) { render_with_scope :new }
          end
        end
    
        def update
          super # no customization, simply call the devise implementation 
        end
    
        protected
    
        def after_sign_up_path_for(resource)
          new_user_session_path
        end
    
        def after_inactive_sign_up_path_for(resource)
          new_user_session_path
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working to integrate facebook in my app. To do that I'm using koala,
Hey all, i want to integrate my Blackberry App with Twitter, and found that
I am trying to integrate a Hibernate application into a proprietary framework. My problem
Is it insane to integrate Git into the project that has nothing to do
I am trying to integrate Qt with OpenCV. Here is the example: http www
I want to integrate AdMob ads in my iPhone app. I'm using IB way
I am attempting to integrate Stripe's recurring payment system with Devise, using Ryan's recent
I am using MGTwitterEngine to Integrate twitter in my app.It works fine up to
I'm going to need to integrate a Java application that I wrote with a
I'm having difficulty deploying a web app that has forms authentication to IIS 7.5.

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.