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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:09:09+00:00 2026-06-14T07:09:09+00:00

I have such validation structures: validates :upload_file_name, :presence => true, :format =>{:with => %r{\.(jpg)$}i,:message

  • 0

I have such validation structures:

validates :upload_file_name,  :presence   => true,
                              :format     =>{:with => %r{\.(jpg)$}i,:message =>"should have an extension .jpg"}
                                
validates_uniqueness_of :upload_file_name, :message => "is already in the database"

And when I type in rails console and i get the following answer

 > s.errors.full_messages

 => ["Upload file name is already in the database"] 

I need the message to be only "is already in the database" without "Upload file name"
How can I do it? This second solution of this problem did not help me as I get an error:

en:
  activerecord:
    errors:
        full_messages:
            format:"%{attribute} %{message}"


1.9.3-p286 :002 > s.save()
   (0.2ms)  begin transaction
  Upload Exists (0.3ms)  SELECT 1 AS one FROM "uploads" WHERE "uploads"."upload_file_name" = 'Katja.jpg' LIMIT 1
   (0.3ms)  rollback transaction
Psych::SyntaxError: (/home/katja/Desktop/tors-jquery-fileupload-rails-paperclip-example-b0b9934/config/locales/en.yml): found character that cannot start any token while scanning for the next token at line 6 column 1
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:203:in `parse'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:127:in `load'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:297:in `block in load_file'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:297:in `open'
    from /home/katja/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/psych.rb:297:in `load_file'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:171:in `load_yml'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:157:in `load_file'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `block in load_translations'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `each'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `load_translations'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:57:in `init_translations'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:71:in `lookup'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n/backend/base.rb:26:in `translate'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/i18n-0.6.0/lib/i18n.rb:156:in `block in translate'
... 25 levels...
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/validations.rb:50:in `save'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/attribute_methods/dirty.rb:22:in `save'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:208:in `transaction'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:241:in `block in save'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.6/lib/active_record/transactions.rb:240:in `save'
    from (irb):2
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in `start'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in `start'
    from /home/katja/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.6/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
  • 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-14T07:09:10+00:00Added an answer on June 14, 2026 at 7:09 am

    Solution:

    s.errors.message[:upload_file_name]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have javascript validation that validates items such as textboxes, radio buttons etc. How
I have such problem: I'm using rails, devise gem and jQuery validation plugin. I
I have problem with validation such code function show_help_tip(event, element) { var $e =
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
i have such code (copy paste from wiki). Its multiplication of those big numbers
I have such XML structure which was returned by SharePoint web services. <rs:data ItemCount=4
i have such function to solve some logic riddle iloczyny is list with such
I have such a grid square disk. Every grid represents a pixel. My aim
I have such tables in my database like Customer , Member , Instructor ,
I have such a for loop: for (var i = 0; i < documentsCount;

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.