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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:13:46+00:00 2026-05-19T04:13:46+00:00

I’m doing a simple user with profile application. User registers and are automatically logged

  • 0

I’m doing a simple user with profile application. User registers and
are automatically logged in. Works fine so far. Now, I’d like to
create a profile after a successful registration and redirect the user
to his/her profile.

I have a User model and controller. Devise also created the
registration controller. I installed the gem. I copied over the devise
files and I plan to override the create action.

First, whatever I edit in registrations_controller.rb nothing
changes.

class Devise::RegistrationsController < ApplicationController
 prepend_before_filter :require_no_authentication, :only =>
[ :new, :create, :cancel ]
 prepend_before_filter :authenticate_scope!, :only =>
[:edit, :update, :destroy]
 include Devise::Controllers::InternalHelpers

Secondly, how to insert the profile creation step?

def create
   build_resource

   if resource.save
     if resource.active?
       set_flash_message :notice, :signed_up
       sign_in_and_redirect(resource_name, resource)
     else
       set_flash_message :notice, :inactive_signed_up, :reason =>
resource.inactive_message.to_s
       expire_session_data_after_sign_in!
       redirect_to after_inactive_sign_up_path_for(resource)
     end
   else
     clean_up_passwords(resource)
     render_with_scope :new
   end
 end

I was thinking to add

 current_user.create_profile under is resource.active?

How would you guys tackle that issue?

  • 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-05-19T04:13:47+00:00Added an answer on May 19, 2026 at 4:13 am

    First, Please format your post and use <code> blocks for the snippets. That way it becomes very readable.

    Coming to your problem:
    Devise by default sign ins and redirects to application root_path, after registration.
    If you wish to redirect to some other path you can specify it in a couple of ways.
    One is to specify root_path for your devise reource. So in your case it will be

    match '/user/profile/new' => 'profiles#new', :as => 'user_root'
    

    This will redirect you to profile#new every time you login.
    To prevent redirecting to profile#new each time you can add a before_filter on profile#new to check if profile exists and redirect to some other page, say dashboards, if profile exists.

    Here is the link showing how to change redirect_path for devise:
    https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-in

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.