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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:10:40+00:00 2026-06-14T13:10:40+00:00

I am using this upload file example . And I am trying to modify

  • 0

I am using this upload file example.

And I am trying to modify a :url of the attached file.It does not work somehow.I get this error in the terminal:

NoMethodError (undefined method `upload_file_size' for #<Paperclip::Attachment:0x8ca35e8>):

My upload.rb:

class Upload < ActiveRecord::Base
  attr_accessible :upload, :upload_file_name, :upload_file_size

Paperclip::interpolates :upload_file_size do |attachment, style|
  attachment.instance.upload_file_size
end
  has_attached_file :upload,

                    :url =>"/system/Files/CEL-Files/:upload_file_size/:basename.:extension",
                    :path =>":rails_root/public/system/Files/CEL-Files/:piks/:basename.:extension"

  include Rails.application.routes.url_helpers

And this is my schema.rb:

ActiveRecord::Schema.define(:version => 20120731045929) do

  create_table "uploads", :force => true do |t|
    t.string   "upload_file_name"
    t.string   "upload_content_type"
    t.string   "user"
    t.integer  "upload_file_size"
    t.datetime "upload_updated_at"
    t.datetime "created_at",          :null => false
    t.datetime "updated_at",          :null => false
  end

end

Thanks in advance

  • 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-14T13:10:41+00:00Added an answer on June 14, 2026 at 1:10 pm

    The symbol/string you are using in Paperclip interpolation is conflicting with your model attribute “upload_file_size”. Try changing Paperclip interpolation custom name from “upload_file_size” to something else. Like below :

    Paperclip::interpolates :size_of_file do |attachment, style|
      attachment.instance.upload_file_size
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this traceback when trying to upload a file using put_file (source code
I am trying to upload a pdf file using webservice api. But this api
I am using the jQuery-File-Upload widget (although I believe this question can generalize to
I am trying to upload my app's updates via Xcode to itunesconnect using this
I'm trying to use this fileUpload component example to work in my own project.
I'm using uploadify + s3, and when trying to upload a file that has
I am trying to fake a file upload without actually using a file input
I am going mad trying to find an example of file upload code in
I'm trying to do a ajax file upload using django. I am trying to
I trying to upload a zip file. In my project i am using DWR

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.