在rails2.0以下版本下开发的时候,参照“整合File-Column和Rmagick功能实现图片上传“http://airport.javaeye.com/blog/33216
就可以实现图片的上传。
但是在rails2.0中,当在show.html.erb实现图片显示:
原始大小:
<%= image_tag url_for_file_column 'entry', 'image' %>
<br>
thumb:
<%= image_tag url_for_file_column 'entry', 'image' ,'thumb'%>
报错提示:
Show ...
当我升级成功后,运行Rail1.2.5版本的项目,出现了错误:
HTTP 500 - 内部服务器错误
Internet Explorer
网上找了好久也无果,不知道谁知道错误的原因?,听说是要在environment.rb中作修改,我不太清楚
目标:做一个博客系统,有两张表,分类(post_categories)和文章(posts).想保持rails的scaffold,尽量减少代码编写,来完成CRUD功能。
1。数据库表:
\db\migrate\002_create_post_categories.rb
create_table :post_categories do |t|
t.column :name, :string, :null =>false
\db\migrate\002_create_post.rb
create_table ...
我做一个文章发表的系统,数据库中有表posts(id,title,content).
controller中定义了文件:post_controller.rb,其中有方法:
ruby 代码
def list
@post_pages, @posts = paginate :posts, :per_page => 5
end
在Views ...
在练习字符串的例子的时候,遇到这个问题:
"abc".each_byte{|c| printf"<%c>",c} 输出结果:<a><b><c>
"abc".each_byte{|c| print"<%c>",c} 输出结果:<%c>97<%c>98<%c>99
搞不懂print和printf到底有什么区别,他们的各自实现机制是什么呢?
- 浏览: 1266 次
- 性别:

- 来自: 成都

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
关于Rails2.0下的File-Col ...
pure 写道<%= image_tag url_for_file_col ...
-- by distortion -
关于Rails2.0下的File-Col ...
<%= image_tag url_for_file_column 'gr ...
-- by pure -
升级到Rails2.0 ,出现HT ...
看看log里怎么说。
-- by ashchan -
rails中scaffold自动生成 ...
找到了,修改views的_form.rhtml
-- by kenrome -
rails中scaffold自动生成 ...
kenrome 写道<p><strong>目标:做一个博客系统,有两 ...
-- by 9esuLuciano






评论排行榜