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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:22:49+00:00 2026-05-30T05:22:49+00:00

I want to submit some information that isn’t a column on a model, so

  • 0

I want to submit some information that isn’t a column on a model, so I’m using a select_tag:

= form_for [:admin, @post] do |f|
  = f.error_messages

  %p
    = select_tag :category_name, options_from_collection_for_select(Category.all, :id, :category_name)
  ...

It generates html that looks right:

<form id="edit_post_1" class="edit_post" method="post" action="/admin/admin_posts/1" accept-charset="UTF-8">
<div style="margin:0;padding:0;display:inline">
<p>
<select id="category_name" name="category_name">
<option value="6">City</option>
<option value="7">College</option>
<option value="8">Sports</option>
<option value="9">Work</option>
</select>
</p>
<p>
<label for="subcat_prefix">Subcategory Name</label>

But the Rails controller always sees "category_name"=>"", in the params. I’m missing something obvious, but what?

Edit: server log on submitting:

Started POST "/admin/admin_posts/1" for 127.0.0.1 at 2012-02-22 15:06:52 -0800
  Processing by Admin::AdminPostsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"CmG+YPFuaKfg+liipxJI6PKQHmbdJ4m2VtJmeD2dRqk=", "post"=>{"subcat_prefix"=>"In", "subtopic_name"=>"City perferendis", "post_content"=>"Explicabo dolor totam fuga voluptatem nam voluptatibus voluptatibus beatae aliquam ducimus et voluptate deleniti dignissimos et. Eum ipsam quos quo voluptas laboriosam delectus adipisci veniam similique libero eaque dolor dolorem libero autem ex aliquam non"}, "category_name"=>"", "commit"=>"Update Post", "id"=>"1"}
  • 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-30T05:22:50+00:00Added an answer on May 30, 2026 at 5:22 am

    There might be another field with the same name lower which is overwriting the value.

    Check with running document.querySelectorAll('[name=category_name]') in your js console.

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

Sidebar

Related Questions

I want to submit a with using jquery as below; $(#formid).submit(); Its working perfect
I don't want to submit projectname.project folder. Now, I use like that git add
I have a form on a non-SSL page that I want to submit as
on my website I have an Enroll page where users submit some basic information,
I am using an API to collect some information. I send a form using
I want to use jQuery to submit my form and i can do that
I want to submit an app to the app store. The app has been
I want the submit button to disappear after it's clicked and a new layer
I want to submit a form like this: <input type=button onclick=$('#form1').submit(); value=Create /> but
I have a case where i want to submit a form and get the

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.