
rails ruby
文章平均质量分 67
cinic2003
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
格式化时间
例如有个时间t = Time.now,格式化有:t.to_s(:long)t.to_s(:short)t.to_s(:db)还可以调用strftime方法加以参数:参看其参数,运行:ri Time.strftimeFormat meaning: %a - The abbreviated weekday name (``Sun'') %A - The full weekd...原创 2011-05-10 12:30:44 · 122 阅读 · 0 评论 -
Gem::Specification
在Mac OSX 10.6.7上运行gem update --system后,可能会出现: NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01. Gem::Specification#default...原创 2011-05-19 13:19:13 · 920 阅读 · 0 评论 -
undefined method 'task'问题
在rails3.0,rake0.9.0下,rake时会报undefined method `task'的错误,解决方法,在Rakefile文件中加入一下代码: require 'rake/dsl' 转自:http://www.aiseeu.com/blog/archives/501.html 说明:https://github.com/jimweirich/rake/pul...原创 2011-05-30 13:48:00 · 172 阅读 · 0 评论 -
multiple routing files in rails3
in config/application.rb: config.paths.config.routes << File.join(Rails.root, "config/folder_name/route_file.rb")原创 2011-05-30 22:20:04 · 112 阅读 · 0 评论 -
Request as XML
If a controller need process all request as XML instead of HTML as default,you can code in this controller like this before :force_to_xml private def force_to_xml request.format = :xml...原创 2011-05-31 15:51:45 · 148 阅读 · 0 评论 -
Module Cache Sweeping
在项目的app下新建目录sweeper,在该目录下新建sweeper类的文件,如listen_sweeper.rb class class ListenSweeper < ActionController::Caching::Sweeper observer User, Production #observer Model you wanted def afte...原创 2011-06-02 10:25:33 · 119 阅读 · 0 评论 -
Resque
Resqus: git://github.com/defunkt/resque.git 来自于railscasts 安装redis,并启动redis sudo redis-server /etc/redis.conf 在项目中配置redis,在config/下新建resque.yml defaults: &defaul...原创 2011-06-24 10:26:59 · 332 阅读 · 0 评论 -
Open Flash Chart with Rails3
http://pullmonkey.com/projects/open_flash_chart2 在rails3项目中安装OpenFlashChart的插件 rails plugin install git://github.com/pullmonkey/open_flash_chart.git 在某个controller的action中 def index @g...原创 2011-06-30 15:21:43 · 141 阅读 · 0 评论