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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:33:10+00:00 2026-05-28T04:33:10+00:00

By default, simple_form generates error messages in this form: <span class=error>error_text</span> but what i

  • 0

By default, simple_form generates error messages in this form:

 <span class="error">"error_text"</span>

but what i need is something like:

 <span class="error" title="error_text"></span>

so it would just be a span with a background image, showing error message when you hover on it

I studied answers for this ( Customize error message with simple_form) question, but it didn’t seem to contain what I need: accepted answer suggests to customize config/initializers/simple_form.rb . But I couldn’t find how exactly you could do it from there, it just allows to change tag containing error meassage, it’s class and which message to display.

  • 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-28T04:33:11+00:00Added an answer on May 28, 2026 at 4:33 am

    This is how my colleague (MORE experienced) handled this:

    Added custom_errors.rb to lib/simple_form
    
    module SimpleForm
      module Components
        module CustomErrors
          include SimpleForm::Helpers::HasErrors
    
          def custom_error
            enabled_error
          end
    
          def error_tag
            options[:error_tag] || SimpleForm.error_tag
          end
    
          def error_text
            if options[:error_prefix]
              options[:error_prefix] + " " + errors.send(error_method)
            else
              errors.send(error_method)
            end
          end
    
          def error_method
            options[:error_method] || SimpleForm.error_method
          end
    
          def error_html_options
            html_options_for(:error, [SimpleForm.error_class])
          end
    
          protected
    
          def enabled_error
            # We need '<span title="Blah!"></span>'
            template.content_tag(error_tag, '', error_html_options.merge({:title => error_text})) if has_errors?
          end
    
          def disabled_error
            nil
          end
    
          def errors
            @errors ||= (errors_on_attribute + errors_on_association).compact
          end
    
          def errors_on_attribute
            object.errors[attribute_name]
          end
    
          def errors_on_association
            reflection ? object.errors[reflection.name] : []
          end
        end
      end
    
      module Inputs
        class Base
          include SimpleForm::Components::CustomErrors
        end
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How change default id or class, which produce simple form: = simple_form_for(@account, url: account_url,
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and
I have a really standard splash screen, just a simple Default.png, but for whatever
Is there a simple way to change the default error values in the jQuery
I implemented a simple sitemap class using Django's default sitemap application. As it was
This relates to computed columns and default constraints (and possibly other expressions) in SQL
In this tutorial he creates a custom login form, just to show how it
In Asp Net Mvc (3) I like to be able to have a default
I would like to develop a simple point&click game in C# with the default

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.