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

  • Home
  • SEARCH
  • 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 9256071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:51:19+00:00 2026-06-18T11:51:19+00:00

I use devise_invitable with Rails and need some help. I want make user logged

  • 0

I use devise_invitable with Rails and need some help. I want make user logged in after accept invitation. Here is my InvitationsController

class InvitationsController < Devise::InvitationsController
  def update
    if User.accept_invitation!(user_params)
      # log in user here
      redirect_to dashboard_show_path, notice: t('invitaion.accepted')
    else
      redirect_to root_path, error: t('invitation.not_accepted')
    end
  end

  private
  def user_params
    params.require(:user).permit(:invitation_token, :password, :password_confirmation)
  end
end

You can see comment in code

# log in user here

here I want log in the user who has accept the invitation.

Thanks.

  • 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-18T11:51:20+00:00Added an answer on June 18, 2026 at 11:51 am

    The method your looking for is sign_in, try this:

    def update
      if User.accept_invitation!(user_params)
        sign_in(params[:user])
        redirect_to dashboard_show_path, notice: t('invitaion.accepted')
      else
        redirect_to root_path, error: t('invitation.not_accepted')
      end
    end
    

    However I should note that devise_invitable, by default, signs in users after they have accepted an invitation. See the default update action here, if you wish to use the default functionality simply call the super method or don’t implement the update action at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am fairly new to Rails and I need some help. I need
I use Devise in Rails 3. I want to see name of current_user in
I have a Rails Engine, where I want to use Devise. I installed devise
I'm using devise_invitable with devise in my Rails 3 app. I want to give
I have this application where I use Devise and, after login the user is
I have a Rails app that was already setup to use devise with User
I use devise for authentication on Rails. Currently I'm testing some POST functions for
In my app, I use devise to generate User model, add some attributes like
I currently use Devise for user registration/authentication in a Rails project. When a user
I use devise, and I want generate a new object scaffold under devise user

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.