![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 87 阅读 · 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 · 876 阅读 · 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 · 132 阅读 · 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 · 87 阅读 · 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 thisbefore :force_to_xmlprivatedef force_to_xml request.format = :xml...原创 2011-05-31 15:51:45 · 125 阅读 · 0 评论 -
Module Cache Sweeping
在项目的app下新建目录sweeper,在该目录下新建sweeper类的文件,如listen_sweeper.rbclass class ListenSweeper < ActionController::Caching::Sweeper observer User, Production #observer Model you wanted def afte...原创 2011-06-02 10:25:33 · 87 阅读 · 0 评论 -
Resque
Resqus: git://github.com/defunkt/resque.git来自于railscasts安装redis,并启动redissudo redis-server /etc/redis.conf 在项目中配置redis,在config/下新建resque.ymldefaults: &defaul...原创 2011-06-24 10:26:59 · 274 阅读 · 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 · 103 阅读 · 0 评论