2008-03-21

关于Rails2.0下的File-Column插件使用

关键字: rails2.0; file_column
在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 ...
2007-12-24

升级到Rails2.0 ,出现HTTP 500 错误

关键字: Rails2.0, http
当我升级成功后,运行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 ...
2007-09-11

Ruby中print和printf的区别

关键字: print,printf
在练习字符串的例子的时候,遇到这个问题: "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到底有什么区别,他们的各自实现机制是什么呢?
kenrome
搜索本博客
博客分类
最近加入圈子
存档
最新评论