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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:27:41+00:00 2026-06-10T01:27:41+00:00

I have <%= f.input :user_type, :label_html => { :class => ‘option_label_name’ }, :label =>

  • 0

I have

<%= f.input :user_type, :label_html => { :class => 'option_label_name' }, :label => "User Type" ,:collection => [["Master"], ["HO Administrator"], ["Practice Manager"], ["Branch Administrator"], ["Consultant"]], :include_blank => false %>
</div>

This creates a list with many options and all that is good but I want to know if there is any way to provide a css styling class to the collection elements only…

As in the current form the styling is provided only to the label and not the options…

I have found one solution… it is not the one that I was looking for but this does work..

<div id="innerblock_left">
<%= f.label :user_type, :class =>"label_name", :label => "User Type" %>
<select class="style2">
<option value="1">Master</option>
<option value="2">HO Administrator</option>
<option value="3">Practice Manager</option>
<option value="4">Branch Administrator</option>
<option value="5">Consultant</option>
</select>
</div>

although it would if great if someone knew how to provide styling to the simple form collection element…

Thank you for reading..

  • 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-10T01:27:42+00:00Added an answer on June 10, 2026 at 1:27 am

    0Just a simple solution :

    In your form helper, define the collection :

    def list
      [["Master",:class => "d_1"], ["HO Administrator",:class => "d_2"], ["Practice Manager",:class => "d_0"],["Branch Administrator",:class => "d_2"], ["Consultant",:class => "d_2"]]
    end
    

    in your form :

    <%= f.input :user_type, :label_html => { :class => 'option_label_name' }, :label => "User Type" ,:collection => list, :include_blank => false %>
    

    and add some CSS tricks in your asset :

    .d_0 {
      font-weight: bold; }
    .d_1{
      font-style: italic;
      text-decoration: underline;
      padding-left: 10px;}
    .d_2 {
      font-style: italic;
      padding-left: 20px;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input form with two textareas allowing a user to type in
What I'm trying to do is have the user input a number, and then
I have a PropertyDataFilter1D input by the user. How do I figure out which
I have an input edit field where the user can enter data. I want
I have a Perl script that takes user input and creates another script that
I have an input which gets a statement from the user. According with the
I have loop designed to validate the user input on a question, it was
I have a string value from a user input box. I have to figure
I have a Login page that captures User input like this. MD5calc ss =
I have a web page that prompts for user input via DropDownLists in some

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.