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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:40:01+00:00 2026-05-23T20:40:01+00:00

<%= select_tag ‘pseudo-attribute’, options_for_select(…), :include_blank => ‘Nowhere’%> This tag used to include a blank

  • 0
  <%= select_tag 'pseudo-attribute', options_for_select(...), :include_blank => 'Nowhere'%>

This tag used to include a blank option with “Nowhere” but now the text box is blank, does anyone know why that is?

  • 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-23T20:40:02+00:00Added an answer on May 23, 2026 at 8:40 pm

    Now the code for the select tag is (Rails 3.1.0.rc4)

      def select_tag(name, option_tags = nil, options = {})
        html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name
    
        if options.delete(:include_blank)
          option_tags = "<option value=\"\"></option>".html_safe + option_tags
        end
    
        if prompt = options.delete(:prompt)
          option_tags = "<option value=\"\">#{prompt}</option>".html_safe + option_tags
        end
    
        content_tag :select, option_tags, { "name" => html_name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
      end
    

    which means you have to replace :include_blank with :prompt. Use include blank if you want a blank option in your select field 🙂

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

Sidebar

Related Questions

i have a select tag,... like this,.. <select style=max-width:150px> <option value='1'>bla bla bla bla
I have a select tag that looks like this: <select name=TZSelector id=TheTZSelector> <option>add another
i am new at ror. option select tag in rails <%= select_tag(:city_id, '<option value=1>Lisbon</option>,<option
How to specify each option at a select tag?,using which attribute (name,id,....)? and how
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
According to HTML specs, the select tag in HTML doesn't have a readonly attribute,
I have the following code: <%= select_tag :role, options_for_select(Project::COMPANY_ROLES.concat(['Other...']), @relationship.role) %> For some reason
How would one get the contents of the 'value' attribute of a select tag,
i have a select tag, with some options <select id=sel> <option>text1</option> <option>text2</option> <option>text3</option> <option>text4</option>
i have a multiple select tag <select multiple=multiple size=5 id=cities_select> <option value=1>city1</option> <option value=2>city2</option>

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.