`
chinapkw
  • 浏览: 109109 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

file_colum

阅读更多
file_column是一款相当不错的,用于上传文件,生成缩略图的一款ROR插件
下面介绍使用方法

安装为组件

./script/plugin install http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk

在model里修改

validates_format_of :image,  
    :with=>/^.*(.jpg|.JPG|.gif|.GIF)$/,  
    :message => "你只能上传JPG或则GIF的图片文件"  
  file_column :image, :magick => {   
         :versions => { "thumb" => "50x50", "medium" => "640x480>" }  
     }  


Just make the "image" column ready for handling uploaded files...

    class Entry < ActiveRecord::Base         file_column :image     end     

在view里修改:

... generate file fields that keep uploaded images during form redisplays to your view...

    <!---->     

... and display uploaded images in your view:

    <!---->     
分享到:
评论

相关推荐

    FCF_Column2D

    zgraphix/public/FusionCharts/FCF_Column2D.swf. Fetching contributors… Cannot retrieve contributors at this time. Raw History. executable file 18.9 KB.

    file-column-0.3.1.tar.gz

    file-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-column-0.3.1.tar.gzfile-...

    解决pandas使用read_csv()读取文件遇到的问题

    如下: 数据文件: 上海机场 (sh600009) 24.11 3.58 东风汽车 (sh600006) 74.25 1.74 中国国贸 (sh600007) 26.38 ...df=pd.read_csv(output_file,encoding='gb2312',names=['a','b','c']) df

    logstash-jdbc.conf

    #如果 use_column_value 为真,需配置此参数. track 的数据库 column 名,该 column 必须是递增的.比如:ID. tracking_column =&gt; MY_ID #指定文件,来记录上次执行到的 tracking_column 字段的值 #我们只需要在 ...

    sqlite 3.40.0 2022-11-16支持FTS3 FTS4

    用python学习peewee时,...RECURSIVE_TRIGGERSDEFAULT_SECTOR_SIZE=4096DEFAULT_SYNCHRONOUS=2DEFAULT_WAL_AUTOCHECKPOINT=1000DEFAULT_WAL_SYNCHRONOUS=2DEFAULT_WORKER_THREADS=0ENABLE_BYTECODE_VTABENABLE_COLUMN_

    在Excel中按条件筛选数据并存入新的表(附源码)

    # 按条件筛选数据,例如筛选出列名为'column_name'的值大于10的行 filtered_data = df[df['column_name'] &gt; 10] # 将筛选后的数据写入新的Excel表 output_file_path = 'filtered_data.xlsx' filtered_data.to_excel...

    Excel Tool of extracting txt file by column

    EXCEL VBA tool of extracting txt file by columns

    ERROR 1406 : Data too long for column 解决办法

    解决办法: 在my.ini里找到 sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_Create_USER,NO_ENGINE_SUBSTITUTION” 把其中的STRICT_TRANS_TABLES,去掉, 或者把sql-mode=STRICT_TRANS_TABLES,NO_AUTO_Create_USER,NO_ENGINE_...

    abadi-column-stores.pdf

    In this article, we survey recent research on column-oriented database systems, or column-stores, where each attribute of a table is stored in a separate file or region on storage. Such databases have...

    Microsoft SQL Server Query File

    ALTER TABLE student DROP column s_home; CREATE UNIQUE INDEX sname_index on student(sname); INSERT INTO student(sno,sname,ssex,sdept,sage,s_birthday) VALUES('2003125','aa','男','qs',18,'2001/12/20');...

    embulk-filter-left_outer_join_json_table:embulk-filter-join_file的前身。未发布且未维护

    用于Embulk的Left Outer Join Json表过滤器插件 JSON表的意思是... 具有以下格式的json...counter_column :json表的列名(字符串,默认值: {name: id, type: long} ) name :列名 type :列的类型(请参见下文)

    Oracle基础知识

    column file_name format a60; set linesize 160; select file_name,round(bytes/(1024*1024),0) total_space,autoextensible,increment_by*&blksz/(1024*1024) as incement,maxbytes/(1024*1024) as maxsize from...

    Tiptop GP ERP数据库DS.SCH文件,Genero Studio设计4fd画面档所需SCH数据库文件

    在使用Genero Studio设计4fd画面档所需SCH数据库文件,为Tiptop GP ERP数据库DS.SCH文件

    洛普扁平非唯一cv工人

    描述{ "name": "Flatten None Unique CSV", "image": "platonam/lopco-flatten-non-unique-csv-worker:latest", "data_cache_path": "/data_cache", "description": "Flatten a Comma-Separated Values file with ...

    PL_SQL命令的使用大全.chm

    SQL*PLUS命令的使用大全 Oracle的sql*plus是与oracle进行交互的客户端工具。...COL[UMN] [{ column|expr} [ option ...]] Option选项可以是如下的子句: ALI[AS] alias CLE[AR] FOLD_A[FTER] FOLD_B[EFORE]

    dist-zilla-plugin-changelogfromgit-debian:Debian 更改日志格式化程序

    # file_name = debian/changelog # wrap_column = 72 # dist_name = squeeze # defaults to stable # package_name = my-package # defaults to lc($self-&gt;zilla-&gt;name) 描述 Dist::Zilla::Plugin::ChangelogFromGit...

    android实现Uri获取真实路径转换成File的方法

    本文实例讲述了android实现Uri获取真实路径转换成File的方法。分享给大家供大家参考。...int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA

    oracle恢复工具-FY_Recover_Data

    AUL&gt; unload object 13677 column varchar file 4; 2006-09-18 22:39:10 2006-09-18 22:39:10 AUL&gt; 因此在意外发生Truncate后, 如果没有备份可以恢复, 首先要做的事是备份一下当前的文件, 免得空间被重用. 而...

    tensorflow没有output结点,存储成pb文件的例子

    Tensorflow中保存成pb file 需要 使用函数 graph_util.convert_variables_to_constants(sess, sess.graph_def, output_node_names=[]) []中需要填写你需要保存的结点。如果保存的结点在神经网络中没有被显示定义该...

    sqlite3在Visual studio 2012下的编译

    Add "SQLITE_ENABLE_COLUMN_METADATA" to the list of preprocessor definitions. Repeat for each configuration (debug/release/Win32/x64). How to make the SQLITE.EXE command-line utility There are ...

Global site tag (gtag.js) - Google Analytics