
ruby and on rails
MUTOUYIHAO
这个作者很懒,什么都没留下…
展开
-
ruby命名规范
变量:局部变量:小写字母或_后接字符(sunil, _z, hit_and_run)实例变量(类内部可见):@打头,后接名字(@sign, @_, @Counter)类变量(类的所有实例共享):@@打头(@@sign, @@_, @@Counte)全局变量:$打头($counter, $COUNTER, $-x)立即数:大写字母后跟单词名,类名字和模块的名字要求符合立即数规范(翻译 2011-10-20 10:13:45 · 1432 阅读 · 0 评论 -
Jruby自动安装包
http://bitnami.org中jrubystack,自动安装,很方便啊原创 2012-08-09 14:34:41 · 754 阅读 · 0 评论 -
ruby 文件读写操作
第一种方法:$result='d:\\rs.txt'File.open($result, "r") do |file| file.each_line do |line| if line.length>20 puts line.chop.length #去掉最后一个换行字符,并显示该行实际字符串的长度 puts line end转载 2012-07-19 09:29:00 · 942 阅读 · 0 评论 -
rubycas-server
rubycas-serverSingle sign-on authentication for enterprise web apps Project HomeDownloadsWikiIssuesSourceSummary People Project In转载 2012-04-10 13:13:43 · 1624 阅读 · 0 评论 -
OpenID流程概述及其与OAuth的区别
目前OpenID在互联网上已经讨论的比较充分,也有很多中文资料。其与OAuth的区别在网络上也有很多介绍。但是,我还是决定将使用OpenID登录的流程图画下来。并初步分析一下OpenID和OAuth之间的区别。 OAuth和OpenID的区别在于应用场景的区别,OAuth用于授权的,是一套授权(Authorization)协议;OpenID是用来认证的,是一套认证转载 2012-04-10 13:49:47 · 1273 阅读 · 1 评论 -
webrick源码分析──主要流程
原文链接webrick作为ruby自带的一个http server,很适合拿来作为学习之用。首先来看看最简单的使用webrick的示例吧Liquid error: No such file or directory - pygmentize -l ruby -f html -O encoding=utf-8这段代码主要是定义了http服务器监听3000端口,转载 2012-03-06 14:27:44 · 1750 阅读 · 0 评论 -
rails点滴
1.The default HTTP method for a link is a get, and the default HTTP method for a button is a post, and rails uses these conventions to determine which method to call对于默认http方法,link是get,button是post方式翻译 2011-11-03 22:07:43 · 630 阅读 · 0 评论 -
rails项目 插件夹具测试
*让测试run起来* 在map/Gemfile下添加以下配置> gem 'user_login', :path => '../user_login'> gem "authlogic" 配置数据库 在map/test/dummy下添加db文件夹,将上层目录的migrate下的东西拷到该目录下,运行rake db:migrate, rake db:test:prepare原创 2011-11-04 15:06:03 · 912 阅读 · 0 评论 -
数据项类型
Rails需要支持多种不同数据库,其本身可使用的数据项类型只是这些数据库所支持数据类型的一个子集。只要通过ActiveRecord支持的数据类型有::string(255个字符内):text(也有限制,30k左右):integer:float:decimal:datetime:timestamp:time:date:binary:boolean(1、0)原创 2011-10-30 10:56:31 · 1241 阅读 · 0 评论 -
view层控件笔记
控件: 30, :rows => 30%> == :checked=>"checked"%> booleanUSA NAME1USA NAME2 'UK')%> 'Canada_Value', 'United Kingdom' => 'UK' })%>form根据@p原创 2011-10-30 13:46:16 · 517 阅读 · 0 评论 -
RubyMine安装、破解
下载地址:http://www.jetbrains.com/ruby/download/index.html破解序列号:name: rubymineLICENSE:70414-12042010 00002VG0BeoZbwmNAMNCx5E882rBEM Ysn1P!e"s830EDlHcWg8gmqYVkvZMo Injf4yqlO1yy"82NiwNzyYI原创 2011-10-26 12:20:02 · 20245 阅读 · 3 评论 -
ubuntu安装 ralis ruby
gem update --system :gem更新安装ruby1.9.21.先去官网下载安装包,略~2.打开终端输入几个命令:(1)tar jxvf ruby-1.9.2-p0.tar.bz2(2)cd ruby-1.9.2-p0(3)./configure –prefix=/usr/local/ruby(4)sudo make(5)sudo make原创 2011-10-23 22:08:30 · 758 阅读 · 0 评论 -
Ruby on Rails Installation on windows xp
You can get all the msgs below listed on the net. Try to google 'ruby on rails ', you can get a more detailed page. But it may occur some errors during your installation, follow the tip, you can sovle原创 2011-10-23 11:16:26 · 583 阅读 · 0 评论 -
html转pdf(rails、jruby、ruby) wkhtmltopdf
wicked_pdf ,测试在jruby下也可用。点击打开链接 # create a pdf from a stringpdf = WickedPdf.new.pdf_from_string('Hello There!')# create a pdf from string using templates, layouts and content option for he原创 2012-08-09 14:31:08 · 2243 阅读 · 0 评论