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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:18:03+00:00 2026-05-20T09:18:03+00:00

today i have direct a problem :P i just need some ideas… how do

  • 0

today i have direct a problem 😛 i just need some ideas…
how do you would write a RESTful filemanager in rails?

i want to use a files controller which does all the operations with the files.
now when i do it restful there are just some few functions:

  • create (create a file/directory)
  • destroy (delete a file/directory)
  • index (list a directory)
  • show (show properties of a file)
  • edit (rename a file/directory)

now i dont know how to copy/move a file…
and when i want a user to have several instances of that filemanager, how do i manage that he can be in different directories? (have different instances of my filemanager in one session)

can anyone just give me some hints? 😛

  • 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-20T09:18:03+00:00Added an answer on May 20, 2026 at 9:18 am

    You can define file as a resource in rails routing. Then you have your RESTful routes. It doesn’t matter for rails if you have a file- or a database-resource. The RESTful routes are the same. The unique identifier for your files could be the unique filename: “/files/file.pdf”.

    I would suggest you to use an abstraction to perform operations on the filesystem (like an Object-Relational Mapping for database access). I could think of carrierwave for example. It handles file uploads and provides basic operations like delete/destroy. Also it allows you to change you storage volume (file, gridfx, amazon s3).

    I’m not sure what you mean with different instances of a filemanager. It would be possible to define a file manager for each user. For instance with carrierwave you can define custom storage dirs:

    # mount uploader in user class
    class User
      mount_uploader :file, UserUploader
    end
    
    # define user uploader
    class UserUploader < CarrierWave::Uploader::Base
      def store_dir
        # model = user object as the uploader
        # is mounted in the user class
        'public/uploads/#{model.id}'
      end
    end
    

    I hope you get an idea!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've run on a little problem today: I have a JS drop down menu
Today, I have seen some legacy code. In the destructor there is a statement
I have just started playing with the ASP.Net MVC framework, and today I created
So I came across an interesting problem today. We have a WCF web service
Lexical analyzers are quite easy to write when you have regexes. Today I wanted
Today i have new problem with JPA/EJB3. I have 2 table User and Group
Just getting started on iPhone dev today and have run through Apple's HelloWorld tutorial:
I'm using SQL Server (2005). Today I have some tables that everytime the data
I have today = new Date(); object. I need to get first and last
hello today i have a problem how can this happen ? everything that is

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.