本站首页    管理页面    写新日志    退出


«July 2025»
12345
6789101112
13141516171819
20212223242526
2728293031


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7570828
建立时间:2006年5月29日




[Ruby on Rails]用rails写完一个小型blog系统后的感想
软件技术

lhwork 发表于 2007/2/7 9:05:10

看完<应用rails进行敏捷web开发>,马上动手开始写一个小型的个人blog系统,基本的功能都有了: 1.日志管理,使用了fckeditor,支持上传图片 2.链接管理 3.评论管理 4.分类管理 5.用户管理和blog设置 写的过程中没遇到什么大问题,有问题用google或者上railscn搜索下基本都能找到答案.时间都是晚上下班后无聊写着玩,在ubuntu下,装了radrails,用起来还蛮爽. 感想?YES,rails给我最大的感触就是 -----"敏捷",请注意,是敏捷,而非速度.我完全按照<应用rails进行敏捷web开发>迭代开发的思路来写,边写边改,雏形很快就出来了.rails非常方便的支持我重构代码和功能,我不需要痛苦的改写配置文件,不需要痛苦的重启服务器,不需要头痛于每次改动对整个系统的巨大影响... 下一步,是想好好把ruby学学,把rub


阅读全文(9818) | 回复(5) | 编辑 | 精华 | 删除
 


[Ruby on Rails]rails的流程图
软件技术

lhwork 发表于 2007/2/7 9:04:37

读R4R,才读完第2章,前两章没什么新内容,算是复习吧 rails的lifecycle: 从浏览器发起一个请求的基本流程: A.server to dispatcher 服务器通过你指定的路径查找dispatcher,比如,你在apache配置: <VirtualHost www.r4rmusic.com>
Se


阅读全文(1820) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]ruby如何动态new对象?
软件技术

lhwork 发表于 2007/2/7 9:04:06

来自railscn的讨论: http://www.railscn.com/viewtopic.php?t=2289 1.eval "obj = #{str}.new"   #只能在irb中使用
2.obj = eval "obj = #{str}.new"
3.obj = eval(str).new
4.c = Object.const_get("Array") 
  s = c.new 相比于java的class.forName,与javascript等脚本语

阅读全文(1724) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]〈ruby cookbook>第一章:String
软件技术

lhwork 发表于 2007/2/7 9:03:44

1.Building a String from Parts: In ruby,String is mutable,you can build a String from a hash like this: hash = { "key1" => "val1", "key2" => "val2" }
string = ""
hash.each { |k,v| string << "#{k} is #{v}/n" }
puts string
2.Subsituting Variables into Strings: Within the string, enclose the variable or expression in curly brackets and prefix it with a hash character. number = 5 "The number is #{number}." #

阅读全文(2012) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]Ruby如何动态调用方法?
软件技术

lhwork 发表于 2007/2/7 9:03:13

也就是反射机制咯,ruby cookbook有专门一章讲这个,调用方法可以使用 obj.method(:methodname).call的形式调用 如果要访问一个obj的一个实例属性值,可以通过 instance_variable_get("@obj")[:attr_name] 或者 instance_variable_get("@obj").send("@attr_name")

阅读全文(2200) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]采用yaml读存配置文件
软件技术

lhwork 发表于 2007/2/7 9:02:34

java中为某个应用自定义配置文件,一般两种方式,采用*.properties或者xml文件,利用java.util.Property或者xml的API读或者存配置信息,如果配置信息多且复杂的话,解析xml是个不小的麻烦事。而ruby,我们可以采用yaml来存储配置信息。 举个简单例子: users = [{:name => 'Bob', :permissions => ['Read']},
         {:name => 'Alice', :permissions => ['Read', 'Write']}]
我们把它存在users文件: open('users', 'w') { |f| YAML.dump(users, f) }
如果在rails的controller中调用上面的代码,将在此应用的根目录下生成一个users文件,如果你希望此文件放在model里,可以这样写:

阅读全文(2218) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]rails有用插件大全(转)
软件技术

lhwork 发表于 2007/2/7 9:01:57

转自: http://my.donews.com/woodstudio/2006/03/25/ruby-on-rails%E6%9C%89%E7%94%A8%E7%9A%84%E6%8F%92%E4%BB%B6/   文件上传(FileColumn)
网页:http://www.kanthak.net/opensource/file_column/
安装:
阅读全文(3004) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]Installing Ruby on Rails on Tiger
软件技术

lhwork 发表于 2007/2/7 8:59:11

This article is now out of date, and has been supplanted by a newer version, located here. Many readers have written-in requesting instructions for manual installation of Ruby, Ruby on Rails, FastCGI, and Apache on Mac OS X 10.4 (Tiger). Rather than making readers wait for the release of these instructions until a time when you can fully flesh them out with commentary, you h

阅读全文(1834) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]Building Ruby, Rails, LightTPD, and MySQL on Tiger
软件技术

lhwork 发表于 2007/2/7 8:56:55

Update: There is a newer, alternate version of this tutorial here: Building Ruby, Rails, Mongrel, and MySQL on Mac OS X. If your goal is to get the latest version of Ruby on Rails up and running using the fewest steps possible, check out the newer artic

阅读全文(3116) | 回复(0) | 编辑 | 精华 | 删除
 


[Ruby on Rails]Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X
软件技术

lhwork 发表于 2007/2/7 8:56:28

This article is a major update to the older (but tried-and-true) post, Building Ruby, Rails, LightTPD, and MySQL on Tiger. Both Ruby, Rails, and their underlying infrastructure have come a long way in recent months, and this article will get you to a leaner, meaner Rails install in less time using fewer steps. This article is updated on a regular basis as new versions of the software are released.

阅读全文(2785) | 回复(0) | 编辑 | 精华 | 删除
 


« 1 2 3 4 5 6 7 8 9 10 »



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.078 second(s), page refreshed 144772403 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号