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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:01:25+00:00 2026-05-25T19:01:25+00:00

I have a select_tag to pick items from a list here’s the code: <%=

  • 0

I have a select_tag to pick items from a list here’s the code:

<%= select_tag "Drinks", options_for_select([ "Water", "Soda", "Beer" ], "Water") %>

After submiting “water” for exemple, it doesn’t show up on the index and show views, on the “Drinks” section.

What am I doing wrong?

Controllers create and update methods

def create
    @facture = Facture.new(params[:facture])

    respond_to do |format|
      if @facture.save
        format.html { redirect_to @facture, :notice => 'Facture was successfully created.' }
        format.json { render :json => @facture, :status => :created, :location => @facture }
      else
        format.html { render :action => "new" }
        format.json { render :json => @facture.errors, :status => :unprocessable_entity }
      end
    end
  end


def update
    @facture = Facture.find(params[:id])

    respond_to do |format|
      if @facture.update_attributes(params[:facture])
        format.html { redirect_to @facture, :notice => 'Facture was successfully updated.' }
        format.json { head :ok }
      else
        format.html { render :action => "edit" }
        format.json { render :json => @facture.errors, :status => :unprocessable_entity }
      end
    end
  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-05-25T19:01:25+00:00Added an answer on May 25, 2026 at 7:01 pm

    You should use this:

    select_tag "facture[drinks]", options_for_select([ "Water", "Soda", "Beer" ], "Water")
    

    The create method is using the values sent in params[:facture] and using “facture[drinks]” will include it as params[:facture][:drinks].

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

Sidebar

Related Questions

I want to have a select-only ComboBox that provides a list of items for
I have a select_tag populated from a @users array that I'm using to perform
I have the following HTML: <ul class=vertical_menu no_select> <li class=edge_top>&nbsp;</li> <!-- Menu Items Here
Right now, I have SELECT gp_id FROM gp.keywords WHERE keyword_id = 15 AND (SELECT
I have a select query that currently produces the following results: Description Code Price
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I have a select tag that is populated with a list of files each
I'm trying to get webrat to select a radio button from a list, using
i have problem passing data from one page to another using GET, for example
I need expert advice here... I have run into the strangest problem in my

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.