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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:29:20+00:00 2026-06-18T00:29:20+00:00

I am working on an application that has several areas which require user to

  • 0

I am working on an application that has several areas which require user to be logged in to access. (I am using devise for logic).

I am currently using the following in my application controller to remember the target url (the link someone clicks on (that requires authentication)) such that it will take the user there after authenticating (as per How to direct user to a specific page after logging in with Devise and Rails) .

class ApplicationController < ActionController::Base
  helper :content
  protect_from_forgery


  def after_sign_in_path_for(user)
    origin_path = session[:origin_path]
    default_redirect_path ="/"
    clear_origin_path
    if origin_path.present?
      origin_path
    else
      params[:target].presence || default_redirect_path
    end
  end

  private

  def authenticate_user!
    store_origin_path
    super
  end

    def store_session
    store_origin_path

  end

  def store_origin_path
    session[:origin_path] = request.fullpath
  end

  def clear_origin_path
    session[:origin_path] = nil
  end


end

This all works great, but I have just noticed that when I try to access “/users/edit”, I am now given the error:

ArgumentError in Devise::RegistrationsController#edit

wrong number of arguments (1 for 0)
Rails.root: /home/james/*******

Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:19:in `authenticate_user!'
Request

Parameters:

None
Show session dump

_csrf_token: "XmrTSQOQ3Z0XTSn14LAX8LtMNVOwM4q3bQ+UhxjvgGM="
session_id: "2caaccc944774f2a7ac6f440c2f442d9"
user_return_to: "/my_tendersave"
warden.user.user.key: ["User", [1], "$2a$10$foTK/Em72/E0rILIuUv7su"]
warden.user.user.session: {"last_request_at"=>2013-01-25 01:48:43 UTC}
Show env dump

GATEWAY_INTERFACE: "CGI/1.2"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.3"
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"
HTTP_ACCEPT_LANGUAGE: "en-GB,en-US;q=0.8,en;q=0.6"
REMOTE_ADDR: "127.0.0.1"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
Response

Headers:

None

What can I do to ensure this works?

Do I need to change the application Controller?

Or override some other devise methods.

Thanks in advance for your help.

  • 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-18T00:29:22+00:00Added an answer on June 18, 2026 at 12:29 am

    I simply renamed the method in application controller and called the correct superclass method.

    ie.

      def authenticated_user!
        store_origin_path
        authenticate_user!
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, a spring application I am working on has several wizards that it is
I'm currently working in an application that has to navigate a webpage and recollect
I am currently working on an application that has different permissions/users for the local
I'm currently working on a large and old C++ application that has had many
I have an application that I am working on that has several viewControllers, with
I'm working on an Android application that has several Activities. In it I have
We're designing an Android app that has several activities which are working in a
I am working on Android application that has several threads - one of them
I am working on a Java application which has a threading issue. While using
I'm working on a application which supports several languages and has a functionality in

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.