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

  • Home
  • SEARCH
  • 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 447463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:34:22+00:00 2026-05-12T21:34:22+00:00

I am attempting to add a note capability to my CRM that I am

  • 0

I am attempting to add a note capability to my CRM that I am creating.I am employing an authenticated environment where users can manage their prospects. For instance, I sign up, I login, I can enter prospects and view them. So…I have created a prospects and user table and have them all working great. I am now trying to give the users the ability to take a note and “attach” it to a prospect. So…I have created a notes table with the columns, note & prospect. The user can take a note from wherever they pull this form, and my goal is to have their clients names available in a dropdown box to attach to the form. So far I have created an object in the prospects controller that says the following

def index
    @myprospects = current_user.prospects.find(params[:id])
  end

I am struggling with the next step to create the dropdown in the view/notes/new.html.erb file. The form looks like this:

<h1>New note</h1><hr/>

<% form_for(@note) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :note %><br />
    <%= f.text_area :note %>
  </p>
  <p>
    <%= f.label :prospect %><br />
    <%= f.text_field :prospect %>
  </p>
  <p>
    <%= f.submit 'Create' %>
  </p>
<% end %>

<%= link_to 'Back', notes_path %>

How do I map the

  <p>
    <%= f.label :prospect %><br />
    <%= f.text_field :prospect %>
  </p>

field to display the data I want? I am three days into rails so talk to me like I am a 10 year old (a 10 year old that doesn’t know rails).

  • 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-12T21:34:23+00:00Added an answer on May 12, 2026 at 9:34 pm

    You’re looking for a select box.

    Rails provides a lot of helpers to create form inputs. The right one for your job is collection_select.

    Assuming you’ve set up a many-to-one relationship between notes and prospects properly, and the column that contains a prospect’s name in the prospects table is called ‘name’, this will do exactly what you want:

    <p>
      <%= f.label :prospect %><br />
      <%= f.collection_select :prospect_id, @myprospects, :id, :name, :prompt => "Select a prospect" %>
    </p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to add a custom dialog box to my current GUI that can
I am attempting to add some entities that I have created. When I try
Am attempting to add push notifications to an application that I have created. I
I'm attempting to add a drop down to a page that already has a
Environment: Windows XP SP3, C#, .Net 4.0 Problem: I'm attempting to add access to
I am attempting to add a function that will create a csv for download
I am attempting add a tableadapter to a stored procedure in my SQL Server
I am attempting add some tests to an existing QT GUI application using QTest.
I'm attempting to add searching support for my PHP web app using MySQL's FULLTEXT
I am attempting to add an Interbase connection pool to GlassFish v3 to use

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.