
ruby on rails
iteye_7153
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ruby_学习笔记:字符串处理函数
1.返回字符串的长度 str.length => integer 2.判断字符串中是否包含另一个串 str.include? other_str => true or false "hello".include? "lo" #=> true "hello".include? "ol" #=> false &原创 2009-11-03 11:24:11 · 124 阅读 · 0 评论 -
ActionController::InvalidAuthenticityToken解决办法
第一种: class FooController < ApplicationController protect_from_forgery :except => :index # you can disable csrf protection on controller-by-controller basis: skip_before_fi...原创 2009-12-21 16:49:45 · 146 阅读 · 0 评论 -
Ruby -- Hash方法汇总
一。给Hash添加默认值 : h = {1,2,3,4} #=> {1 => 2, 3 => 4} h.default = 7 h[1] #=> 2 h[3] #=> 4 h[4] #=> 7 h[5] #=>...原创 2010-01-18 16:14:45 · 148 阅读 · 0 评论 -
Rails 使用Haml代替Rhtml
什么是Haml Haml,一款简洁的的类似Rhtml的插件,可以极大的简少写xhtml等视图代码的量。 安装haml 安装gem sudo gem install haml 安装haml plugin至rails haml –rails [rails路径] 如 haml –rails . 则安装haml插件至当前目录 第一个haml %h1 Chapters#index...原创 2009-07-22 21:22:13 · 178 阅读 · 0 评论 -
Haml 参考大全 Haml教程
Haml是一种用来描述任何XHTML web document的标记语言,它是干净,简单的。而且也不用内嵌代码。Haml的职能就是替代那些内嵌代码的page page templating systems,比如PHP,ERB(Rails的模板系统),ASP。不过, haml避免了直接coding XHTML到模板,因为它实际上是一个xhtml的抽象描述,内部使用一些code来生成动态内容。它有什么...原创 2009-07-24 12:55:04 · 788 阅读 · 0 评论 -
rails笔记: 常识
view分为 builder模式和rhtml模式 builder模式例子如下,rails自带 xml.div(:class => "productlist") do xml.timestamp(Time.now) @products.each do |product| xml.product do xml....原创 2009-07-30 14:45:53 · 138 阅读 · 0 评论