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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:23:47+00:00 2026-05-28T01:23:47+00:00

I am new to Ruby on Rails and set myself a little project to

  • 0

I am new to Ruby on Rails and set myself a little project to get to grips with it. The project is simple just a basic jobs board where a person can post a job. I Also want to have users to have a skills section. I have the user created along with sessions and also got the jobs created so the user can post a job and only edit their own ect. I now want the user to add skills associated to themselves. I am confused on how I can achieve this in terms of when viewing a users profile in the user view, it will also display their skills. I assume I need t create a new scaffold for the skill and create a relationship user has_many skills ect. Is this along the right lines? Also how can i get the skills to be shown on the users profile.

Any help would be really appreciated.

  • 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-28T01:23:48+00:00Added an answer on May 28, 2026 at 1:23 am

    You are definitely on the right track. What you need to do it setup the Skill model/scaffold to have in addition to its usual fields, a user_id of type integer. This is to store the foreign key of the user that the skill be. Then you can setup the Skill model to have a belongs_to association with the user. So in the code you can do things like:

    @skill.user
    @user.skills
    

    Essentially, once a user has skills connected to them, it’s relatively easy to show them on /user/1 for example

    <p><%= @user.name %> has the following skills</p>
    <ul>
    <% @user.skills.each do |skill| %>
      <li><%= skill.title %></li>
    <% end %>
    </ul>
    

    I’m just guessing on the attribute names there, but you get the idea.

    However

    To be completely honest, I would actually attack this from a many to many methodology. Where you have two separate models, Skill and User. Then you have one in between called SkillsUser (lacking the ending pluralization for the table name). This means you can have a set of saved skills such as.

    • Mathematics
    • Computing
    • Programming
    • Marketing skills

    And then associate the one skill record to multiple users.

    class Skill < ActiveRecord::Base
      has_many :skills_users
      has_many :users, :through => :skill_users
    
    end
    
    class User < ActiveRecord::Base
      has_many :skills_users
      has_many :skills, :through => :skill_users
    
    end
    
    class SkillUser < ActiveRecord::Base
      belongs_to :skill
      belongs_to :user
    end
    

    Both models having the two has_many declarations basically allows you to still use things like:

    @user.skills
    @skill.users
    

    Without having to reference the join model in between.

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

Sidebar

Related Questions

I'm a new ruby/rails user trying to get my mac set up for the
So, I just moved to new project that is built on Ruby on Rails.
I've set up a new Rails 2.3.2 app and added the Basecamp API ruby
I'm new to ruby/rails and trying to build a simple Projects / Tags app
I'm new to Ruby on Rails (I know Ruby just decently though) and looking
I'm new to Ruby and Rails and I have a simple controller that shows
I'm brand new at Ruby. Trying to set up the first application/project using Aptana
I'm fairly new to Ruby on Rails, and I have a project with a
New to Ruby and Rails, and I'm hitting a snag getting set up. I
I'm working on a ruby on rails project that requires recording some simple 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.