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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:11:33+00:00 2026-06-08T03:11:33+00:00

Environment: Rails 3.2.3 with Devise I would like to add a registration code to

  • 0

Environment: Rails 3.2.3 with Devise

I would like to add a registration code to the registration form. The registration code is NOT in the users table. There’s a separate registration_codes for that. The reason it’s in the registration form, is that I would like to compare the code entered by the user filling out the registration form to what’s in the registration codes table, and produce a value that will go into the users table.

I am getting an error message:

undefined method `registration_code' for #<User:0x007f91b57b7890>

and it’s pointing to the code that displays the registration_code text box in views/registrations/new.html.erb

How do I get around the fact that registration_code is not part of the users table? The form was working fine, until I added the registration_code field to the form.

  • 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-08T03:11:35+00:00Added an answer on June 8, 2026 at 3:11 am

    I would create a method in your User model that handles your registration code logic:

    def registration_code=(code)
      # Check registation_codes table and produce a value that will go into the users table
    end
    

    Submitting a form with this new field should now call this method with the submitted value

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

Sidebar

Related Questions

I'm having trouble seeding my users table. (rails 3.2.6, jruby 1.6.7.2, devise 2.1.2) It's
Environment: Rails 3.0.1, MySQL I have a Users table, and I want to search
My environment: Rails 3.2.x with RVM, Passenger, Apache on Linux (Ubuntu), I am not
My environment is Rails 3.0.1 with Devise 1.1. I am developing a mobile web
Environment: Rails 3.0.4 and Ruby 1.9.2 I have the following form: <%= form_tag( {:action
Environment: Rails 3.0.1 Ruby 1.8.7 MySQL 5.5.16 Community server...Jdk 1.6 gem 'sunspot_rails' gem 'sunspot_solr'
My Environment Rails 3.2.1 ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] I want to change
My environment is rails 3.1, heroku bamboo stack, delayed_job_active_record, (https://github.com/collectiveidea/delayed_job ) and experimenting with
I have no rails environment but I want to use cruisecontrol.rb as my Continous
I have a rails environment which I set-up with macports. I recently updated macports

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.