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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:46:55+00:00 2026-05-26T07:46:55+00:00

I’m a beginner programmer and am working on an email confirmation. Once users have

  • 0

I’m a beginner programmer and am working on an email confirmation. Once users have registered it sends them to a page to enter a confirmation code, which will be sent to the email they used. If submitted correctly it saves the User and logs them in.

I had looked into using Devise and maybe that’s the way to go, but it seems I would spend as much time learning someone else’s code when I could learn to do it myself. My repo is Here.

What I was thinking of coding (in my User controller) is shaping up like this…what do you think? Am I completely off and would be better figuring out Devise/Authlogic or am I on the right track? I’m using rails 3.1. Any help would be much appreciated. Thanks in advance.

def   confirmation_code_to_register(string)
  @confirmation_code = #random number
end

def create_start
  @user = User.new(params[:user])
  #send email with @confirmation_code via ActionMailer
  redirect_to page_to_enter_confirmation_code
  email_authenticate
end


def email_authenticate
  if #confirmation code user enters == @confirmation_code
    create_finish
  else
    #sorry, you entered the wrong confirmation code. 
  end
end

def create_finish
  if @user.save
    sign_in @user
    flash[:success] = "Welcome to the Site"
    redirect_to @user
  else
    @title = "Sign Up"
    render 'new'
  end
end
  • 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-26T07:46:55+00:00Added an answer on May 26, 2026 at 7:46 am

    Consider using Sorcery instead of Devise. There is Railscast about it.

    https://github.com/NoamB/sorcery

    It more simpler to use, and I think it fulfill your authentication needs.

    PD: Check the Edit I did to your post. Try to use that syntax when you post code (just indent the code, no html markup)

    EDIT:

    And that code should be in the User model, not the controller. Try to keep your controller small, very small. Put all the logic you can in the models.

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

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.