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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:53:00+00:00 2026-06-13T20:53:00+00:00

Hello I have the following models. The User Model: class User < ActiveRecord::Base attr_accessible

  • 0

Hello I have the following models.

The User Model:

class User < ActiveRecord::Base
  attr_accessible :email, :password, :password_confirmation
  has_one :user_informations
  has_secure_password
end

The UserInformation Model:

class UserInformation < ActiveRecord::Base
  belongs_to :user
  attr_accessible :address, :address2, :business, :descripcion, :identification_number, :mobile_cell, :name, :phone_number
end

Now I need to create the view and the controller to create and update the user information, and I have many questions:

1) how can I generate the controller:

rails g controller UserInformations

o

rails g controller UserInformation

2) how my new, create and update action know the user ID.

3) how can I set the routes for this user information

Thanks. Maybe these are a basic question, but I’m new in rails and I don’t know how to do all of this.

Thanks again 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-13T20:53:02+00:00Added an answer on June 13, 2026 at 8:53 pm

    1) You have to use pluralize for controller, so rails g controller UserInformations will work.

    2 + 3) You can set up Restful routes:

    resources :users do
      member do
        get 'user_information'
      end
    end
    

    With above routes you will have path users/:id/user_information, so you can know your user ID through params[:id], ex, in your create or update action you can use:

    user = User.find(params[:id])
    

    to find which user is shown informaton.

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

Sidebar

Related Questions

I have the following models (simplified): class Location(models.Model): name = models.CharField(max_length=100) is_ok = models.BooleanField()
I have a Django model: class Note(models.Model) : text = models.TextField() owner = models.ForeignKey(User)
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
I have following code snippet: class ABC{ public: int a; void print(){cout<<hello<<endl;} }; int
Hello i have this following function: ... var model = $(#carModel); .... model.change(validModel); function
Hello I have the following code: if(_deviceSegmentCntrl.selectedSegmentIndex == 0) { deviceOne = [[NSString alloc]
Hello I have the following code which uses knockout.js, var allJobberDetailsArray = []; getAllJobberDetailsArray();
Hello i have the following problem, I record a video using red5 like this:
I have following simple program: import std.stdio; int main(string[] argv) { writeln(Hello, world!); return
I have the following data: A post called Hello has categories greet Another post

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.