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:
<!---->
分享到:
相关推荐
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.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-...
如下: 数据文件: 上海机场 (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
#如果 use_column_value 为真,需配置此参数. track 的数据库 column 名,该 column 必须是递增的.比如:ID. tracking_column => MY_ID #指定文件,来记录上次执行到的 tracking_column 字段的值 #我们只需要在 ...
用python学习peewee时,...RECURSIVE_TRIGGERSDEFAULT_SECTOR_SIZE=4096DEFAULT_SYNCHRONOUS=2DEFAULT_WAL_AUTOCHECKPOINT=1000DEFAULT_WAL_SYNCHRONOUS=2DEFAULT_WORKER_THREADS=0ENABLE_BYTECODE_VTABENABLE_COLUMN_
# 按条件筛选数据,例如筛选出列名为'column_name'的值大于10的行 filtered_data = df[df['column_name'] > 10] # 将筛选后的数据写入新的Excel表 output_file_path = 'filtered_data.xlsx' filtered_data.to_excel...
EXCEL VBA tool of extracting txt file by columns
解决办法: 在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_...
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...
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的Left Outer Join Json表过滤器插件 JSON表的意思是... 具有以下格式的json...counter_column :json表的列名(字符串,默认值: {name: id, type: long} ) name :列名 type :列的类型(请参见下文)
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...
在使用Genero Studio设计4fd画面档所需SCH数据库文件,为Tiptop GP ERP数据库DS.SCH文件
描述{ "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 ...
SQL*PLUS命令的使用大全 Oracle的sql*plus是与oracle进行交互的客户端工具。...COL[UMN] [{ column|expr} [ option ...]] Option选项可以是如下的子句: ALI[AS] alias CLE[AR] FOLD_A[FTER] FOLD_B[EFORE]
# file_name = debian/changelog # wrap_column = 72 # dist_name = squeeze # defaults to stable # package_name = my-package # defaults to lc($self->zilla->name) 描述 Dist::Zilla::Plugin::ChangelogFromGit...
本文实例讲述了android实现Uri获取真实路径转换成File的方法。分享给大家供大家参考。...int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA
AUL> unload object 13677 column varchar file 4; 2006-09-18 22:39:10 2006-09-18 22:39:10 AUL> 因此在意外发生Truncate后, 如果没有备份可以恢复, 首先要做的事是备份一下当前的文件, 免得空间被重用. 而...
Tensorflow中保存成pb file 需要 使用函数 graph_util.convert_variables_to_constants(sess, sess.graph_def, output_node_names=[]) []中需要填写你需要保存的结点。如果保存的结点在神经网络中没有被显示定义该...
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 ...