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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:54:13+00:00 2026-06-17T12:54:13+00:00

I am relatively new to rails – therefore the question should be very easy

  • 0

I am relatively new to rails – therefore the question should be very easy to answer. I tried to find a solution for the problem in other posts, but I could find it (probably because I don’t know the right vocabulary right now).

Here is my question/ case:

I have two models:

1) Model one: Users

2) Model two: FreelancerData

They are connect through “User has one FreelancerData” and “FreelancerData belongs_to User”. The FreelancerData contains three field “daily_rate”, “status” and “user_id” (= foreign field).

Now I want to create a Form with form_for, in which I can fill in the FreelancerData for the current user.

I tried the following code, but this does not work

<% provide(:title, "Edit freelancer") %>
<div class="row">   
    <aside class="span4">
        <section>
            <%= render ('layouts/profile') %>
        </section>
    </aside>
    <div class="span8">
        <h1>Edit your profile</h1>
        <h5>Please edit your current working status and your daily rate:</h5>
        <%= form_for @user.freelancer_data do |f| %>

          <%= render 'shared/error_messages', object: f.object %>

          <%= f.label :status %>
          <%= f.select :status, ['Busy', 'Available'] %>

            <%= f.label :daily_rate, "Daily rate in Euro ('.' and ',' are not allowed)" %>
          <%= f.text_field :daily_rate %>

          <%= f.submit "Save changes", class: 'btn-large btn-primary' %>

        <% end -%>
        <h5>If you want to change your picture, you can do it here:</h5>
        <%= gravatar_for @user %>
    <a href="http://gravatar.com/emails">change</a>

    </div>
</div>

So my question is: Is it possible to edit data of a associated table FreelancerData through the User Data?

  • 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-17T12:54:14+00:00Added an answer on June 17, 2026 at 12:54 pm

    Yup. You can use fields_for. Check out this link.

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

Sidebar

Related Questions

I am relatively new to ruby on rails, so this question might be easy.
I'm relatively new to Rails development and I'm having a minor associations problem. I'd
I'm relatively new to Ruby on Rails and occasionally I find this convention-over-configuration stuff
I am relatively new to rails and think that my problem may, in part,
Probably a stupid question but I'm relatively new to Rails and wondering how Rails
Relatively new to rails and trying to model a very simple family tree with
Relatively new to rails, I'm working on a simple rails app for a few
There are several stages to this, and as I am relatively new to rails
I'm relatively new to RoR and I'm curious about why Rails compiles assets both
Im relatively new to the Android world but I have a quick question. I

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.