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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:32:04+00:00 2026-06-11T04:32:04+00:00

I have two databases in my app. One is Projects, that holds data on

  • 0

I have two databases in my app. One is Projects, that holds data on projects created in the app and another is User that I made when installing the Devise gem that holds the usernames and passwords of all the people that can use the app.

I have a page where the user can create a new project to be submitted into the database.

I am trying to get the :username field data of the current user from the User database to be submitted along with the data they enter to a new field called username_project.

<%= stylesheet_link_tag "form" %>


<%= form_for(@project) do |f| %>

<%= f.select( :username_project, User.all.map {|p| [p.:username]}) %>


<%= f.submit "Create New Project", :class => "button" %>


<% end %>

At the moment, there is a drop down that shows the Usernames stored in the database, but I am trying to get the <%= current_user.username %> value to be submitted as the username_project value, when the user hits submit. I am new to rails so go easy on me. Thanks in advance.

Update:

<%= stylesheet_link_tag "form" %>


    <%= form_for(@project) do |f| %>

<%= current_user.username %>
<%= f.hidden_field :username_project, :value => current_user.username %>

<%= f.submit "Create New Project", :class => "button" %>


    <% end %>
  • 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-11T04:32:06+00:00Added an answer on June 11, 2026 at 4:32 am

    Use hidden_field helper:

    <%= stylesheet_link_tag "form" %>
    
    <%= form_for(@project) do |f| %>
      <%= f.hidden_field :username_project, :value => current_user.username %>
      <%= f.submit "Create New Project", :class => "button" %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two databases in SQL2k5: one that holds a large amount of static
I have an app that talks to two different databases. For one of my
I have two databases on one machine that also has two different sites running
I have a small app on Heroku's cedar stack that uses two processes. One
My app uses two databases (separate files). To handle these databases I have created
I'm working on an app where a user can have one of two kinds
In my project I currently have two databases, one that is named ASPNETDB.MDF and
I have two databases named: DB_A and DB_B . Each database has one collection
We have two databases, in two separate locations. One of the databases resides in
I am using SQL Server 2008 R2. I have created two different databases Master

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.