Giter VIP home page Giter VIP logo

file_column's Introduction

FEATURES
========

Let's assume an model class named Entry, where we want to define the "image" column
as a "file_upload" column.

class Entry < ActiveRecord::Base
  file_column :image
end

* every entry can have one uploaded file, the filename will be stored in the "image" column

* files will be stored in "public/entry/image/<entry.id>/filename.ext"

* Newly uploaded files will be stored in "public/entry/tmp/<random>/filename.ext" so that
  they can be reused in form redisplays (due to validation etc.)

* in a view, "<%= file_column_field 'entry', 'image' %> will create a file upload field as well
  as a hidden field to recover files uploaded before in a case of a form redisplay

* in a view, "<%= url_for_file_column 'entry', 'image' %> will create an URL to access the
  uploaded file. Note that you need an Entry object in the instance variable @entry for this
  to work.

* easy integration with RMagick to resize images and/or create thumb-nails.

USAGE
=====

Just drop the whole directory into your application's "vendor/plugins" directory. Starting
with version 1.0rc of rails, it will be automatically picked for you by rails plugin
mechanism.

DOCUMENTATION
=============

Please look at the rdoc-generated documentation in the "doc" directory.

RUNNING UNITTESTS
=================

There are extensive unittests in the "test" directory. Currently, only MySQL is supported, but
you should be able to easily fix this by looking at "connection.rb". You have to create a
database for the tests and put the connection information into "connection.rb". The schema
for MySQL can be found in "test/fixtures/mysql.sql".

You can run the tests by starting the "*_test.rb" in the directory "test"

BUGS & FEEDBACK
===============

Bug reports (as well as patches) and feedback are very welcome. Please send it to
[email protected]

file_column's People

Contributors

wpc avatar xli avatar tekin avatar mradha avatar dovadi avatar betarelease avatar timcharper avatar vinayd-tw avatar

Watchers

Ananthu Ramachandran Vineetha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.