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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:03:16+00:00 2026-06-07T16:03:16+00:00

I followed this guide learning how to do file uploads to a secure directory

  • 0

I followed this guide learning how to do file uploads to a secure directory on my server, rather than public (default). When I try to go to the show to view the links, I get:

undefined method `redocument' for #<ActionView::Helpers::FormBuilder:0xa2ae338>
near: <%= link_to File.basename(f.redocument.url), "/uploads/#{f.id}/#{File.basename(f.redocument.url)}" %> 

It is having trouble rendering the link. Am I missing something here? Am I not supposed to copy this code line by line? They don’t specify whether or not I should be replacing ‘redocument’, but my model name is Entry, and the string the file’s link is stored is mv_link. Anyone have any idea what the fix is?

Update: Hopefully in the right direction

I changed all the cases of ‘f.redocument’ to ‘@entry.mv_link’. Now on the show page, the link is there. However when I click it and try to download, the path specified by the controller is broken. This is what the controller was

def download
  path = "/#{redocument.redocument}"
  send_file path, :x_sendfile=>true
end

What should I change this path to?

  • 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-07T16:03:17+00:00Added an answer on June 7, 2026 at 4:03 pm

    OK, going on a limb here… But I think you have something like this setup:

    class Entry < ActiveRecord::Base
      mounts_uploader :mv_link, YourUploaderClass
    end
    

    In your controller, you need to find the Entry and then get the path form the mv_link

    def download
      @entry = Entry.find(params[:id])
      send_file @entry.mv_link.path, disposition: 'attachment', x_sendfile: true
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this guide to install Solr in TomCat running on Windows Server
I've followed this guide : http://symfony.com/doc/current/reference/forms/types/file.html and tested the sample here However when I
So I followed this guide here http://www.kodyaz.com/articles/sql-server-2005-database-encryption-step-by-step.aspx on how to setup encryption for my
So I have followed This guide and used a simple printing python file. Problem
I followed this guide here perfectly and have gone through it again but when
I have followed this guide: http://maven.apache.org/guides/plugin/guide-java-plugin-development.html I have created a maven-plugin project hello-maven-plugin with
I followed this tutorial . But whenever I try to log in with my
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I followed this tutorial http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html I wrote the manifest File giving all the permissions
I followed this guide: http://wiki.unto.net/setting-up-clojure-and-slime Which walked me through the steps of building Clojure

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.