- 浏览: 135474 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
defender:
|
jquery 新建的元素事件绑定问题(下) -
xiaoyao3857:
哇,不仅解决了问题,还知道了问题的源渊!
VI下删除文本中的^M -
a114d:
...
jquery 新建的元素事件绑定问题(下) -
marine8888:
...
ubantu下解压缩中文乱码 -
niuka:
好久没用foreach了 这个属性都忘记了,非常的高兴有人还提 ...
<c:forEach>用法
http://blog.sina.com.cn/s/blog_6721c4c70100ooeb.html
默认路由:
Ruby代码
# Rails3:
match '/:controller(/:action(/:id))'
# Rails2:
map.connect ':controller/:action/:id'
正则路由:
Ruby代码
# Rails3:
match 'products/:id', :to => 'catalog#view'
# Rails2:
map.connect 'products/:id', :controller => 'catalog', :action => 'view'
命名路由:
Ruby代码
# Rails3:
match 'logout', :to => 'sessions#destroy', :as => 'logout'
# Rails2:
map.logout 'logout', :controller => 'sessions', :action => ''
根路由:
Ruby代码
# Rails3:
root => 'welcome#show'
# Rails2:
map.root :controller => 'welcome', :action => 'show'
路由简写技巧:
:to 键的省略:
Ruby代码
match 'account' => 'account#index'
# 相当于:
match 'account', :to => 'account#index'
match 'info' => 'projects#info', :as => 'info'
注意:
:as 在rails3中是改变 helper, 在rails2中是改变 path
当路径和控制器(及action)一至时,可省略指派控制器部分
Ruby代码
match 'account/overview'
# 相当于:
match 'account/overview', :to => 'account#overview'
Verb路由
当需要限制http请求方法的时候通过键 :via ,也可以直接把方法写在最前面:
Ruby代码
get 'account/overview'
# 相当于:
match 'account/overview', :via => 'get'
match 'account/setup', :via => [:get, :post]
# 支持get\post\put\delete四种HTTP方法
resources路由:
Ruby代码
resources :posts, :except => [:index]
resources :posts,nly => [:new, :create]
# edit_post GET /posts/:id/modify(.:format) {:controller=>"posts", :action=>"edit"}
resources :posts, :path_names => { :edit => 'modify' }
resources :projects do
resources :tasks, :people
end
resources :products do
collection do
get :sold
postn_offer, :search
end
get :buy,n => :member
post :batch,n => :collection
end
resource :session do
get :create
end
:shallow用法:
Rails3中的shallow用法与Rails2中一致
Ruby代码
resources :blogs, :shallow => true do
resources :comments
end
使用:shallow前后相同部分:
blog_comments GET /blogs/:blog_id/comments(.:format) {:controller=>"comments", :action=>"index"}
blog_comments POST /blogs/:blog_id/comments(.:format) {:controller=>"comments", :action=>"create"}
new_blog_comment GET /blogs/:blog_id/comments/new(.:format) {:controller=>"comments", :action=>"new"}
blogs GET /blogs(.:format) {:controller=>"blogs", :action=>"index"}
blogs POST /blogs(.:format) {:controller=>"blogs", :action=>"create"}
new_blog GET /blogs/new(.:format) {:controller=>"blogs", :action=>"new"}
edit_blog GET /blogs/:id/edit(.:format) {:controller=>"blogs", :action=>"edit"}
blog GET /blogs/:id(.:format) {:controller=>"blogs", :action=>"show"}
blog PUT /blogs/:id(.:format) {:controller=>"blogs", :action=>"update"}
blog DELETE /blogs/:id(.:format) {:controller=>"blogs", :action=>"destroy"}
使用:shallow前后不同部分:
不使用shallow选项:
edit_blog_comment GET /blogs/:blog_id/comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"}
blog_comment GET /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"show"}
blog_comment PUT /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"update"}
blog_comment DELETE /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"destroy"}
使用shallow选项后:
edit_comment GET /comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"}
comment GET /comments/:id(.:format) {:controller=>"comments", :action=>"show"}
comment PUT /comments/:id(.:format) {:controller=>"comments", :action=>"update"}
comment DELETE /comments/:id(.:format) {:controller=>"comments", :action=>"destroy"}
可以看出使用shallow选项后,对于已经存在的资源使用简化方式操作,具体行为涉及到 edit\show\update\destroy 四种
另外,shallow选项的有效范围是对自身及嵌套的资源都有效,如下面这个例子:
Ruby代码
resources :publishers do
resources :magazines do
resources :albums, :shallow => true do
resources :photos do
resources :images
end
end
end
end
这个例子中 albums、photos、images 都会使用简化方式,而 magazines 不会。特别注意:这种嵌套方式极不推荐,一般嵌套的层级最好不要超过一级
scope路由
:path 改变Path,:module 改变Controller, :name_prefix || :as 改变 helper
Ruby代码
scope 'admin' do
resources :posts
end
# 行当于:
scope :path => 'admin' do
resources :posts
end
生成路由:
posts GET /admin/posts(.:format) {:controller=>"posts", :action=>"index"}
posts POST /admin/posts(.:format) {:controller=>"posts", :action=>"create"}
new_post GET /admin/posts/new(.:format) {:controller=>"posts", :action=>"new"}
edit_post GET /admin/posts/:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
post GET /admin/posts/:id(.:format) {:controller=>"posts", :action=>"show"}
post PUT /admin/posts/:id(.:format) {:controller=>"posts", :action=>"update"}
post DELETE /admin/posts/:id(.:format) {:controller=>"posts", :action=>"destroy"}
Ruby代码
scope :module => 'admin' do
resources :posts
end
# 相当于:
resources :posts, :module => 'admin'
生成路由:
posts GET /posts(.:format) {:controller=>"admin/posts", :action=>"index"}
posts POST /posts(.:format) {:controller=>"admin/posts", :action=>"create"}
new_post GET /posts/new(.:format) {:controller=>"admin/posts", :action=>"new"}
edit_post GET /posts/:id/edit(.:format) {:controller=>"admin/posts", :action=>"edit"}
post GET /posts/:id(.:format) {:controller=>"admin/posts", :action=>"show"}
post PUT /posts/:id(.:format) {:controller=>"admin/posts", :action=>"update"}
post DELETE /posts/:id(.:format) {:controller=>"admin/posts", :action=>"destroy"}
Ruby代码
scope :name_prefix => 'admin' do
resources :posts
end
# 相当于:
resources :posts, :name_prefix => 'admin'
生成路由:
admin_posts GET /posts(.:format) {:controller=>"posts", :action=>"index"}
admin_posts POST /posts(.:format) {:controller=>"posts", :action=>"create"}
new_admin_post GET /posts/new(.:format) {:controller=>"posts", :action=>"new"}
edit_admin_post GET /posts/:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
admin_post GET /posts/:id(.:format) {:controller=>"posts", :action=>"show"}
admin_post PUT /posts/:id(.:format) {:controller=>"posts", :action=>"update"}
admin_post DELETE /posts/:id(.:format) {:controller=>"posts", :action=>"destroy"}
Ruby代码
scope 'admin', :module => 'admin', :name_prefix => 'admin' do
resources :posts
end
# 相当于:
namespace 'admin' do
resources :posts
end
生成路由:
admin_posts GET /admin/posts(.:format) {:controller=>"admin/posts", :action=>"index"}
admin_posts POST /admin/posts(.:format) {:controller=>"admin/posts", :action=>"create"}
new_admin_post GET /admin/posts/new(.:format) {:controller=>"admin/posts", :action=>"new"}
edit_admin_post GET /admin/posts/:id/edit(.:format) {:controller=>"admin/posts", :action=>"edit"}
admin_post GET /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"show"}
admin_post PUT /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"update"}
admin_post DELETE /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"destroy"}
在路由中定义跳转:
Ruby代码
match "/posts/github" => redirect("http://github.com/rails.atom")
# 地址 /foo/1 会自动跳转到 /bar/1s
match "/foo/:id", :to => redirect("/bar/%{id}s")
# /account/proc/inosin 会自动跳转到 /inosins
match 'account/proc/:name', :to => redirect {|params|
"/#{params[:name].pluralize}" }
match "/stories" => redirect {|p, req| "/posts/#{req.subdomain}" }
路由中的限制:
Ruby代码
# 限制 id 只能为数字
match "/posts/show/:id", :to => "posts#index", :id => /\d+/
match "/posts/show/:id", :to => "posts#index", :constraints => {:id => /\d+/}
# 限制子域名
match "photos", :constraints => {:subdomain => "admin"}
# 限制访问者 IP
constraints(:ip => /127.0.0.1/) do
match '/questions', :to => redirect("http://www.stackoverflow.com/")
end
# 当访问者 ip 是 192.168.1.* 的来访者访问 子域名为 "test"
match "/ttt" => proc{|env| [200, {}, ["hello test"]]}, \
:constraints => {:subdomain => "test", :ip => /192\.168\.1\.\d+/}
路由通配符:
Ruby代码
resources :photos, :id => /\d+/
match 'photos/*other' => 'photos#unknown'
#上面这两行路由则会把不符合7种path的其他url全部解析到PhotoController#unknown中去处理,params[:other]可得到path中/photos/之后的部分,注意这两行的顺序不能颠倒
match 'books/*section/:title' => 'books#show'
# 例如:books/some/section/last-words-a-memoir 中 params[:section] = "some/section", params[:title] = "last-words-a-memoir".
match '*a/foo/*b' => 'test#index'
# 例如:zoo/woo/foo/bar/baz 中 params[:a] = "zoo/woo", params[:b] = "bar/baz"
Rack:
Ruby代码
match "/foo", :to => proc {|env| [200, {}, ["Hello world"]] }
match 'rocketeer.js' => ::TestRoutingMapper::RocketeerApp
RocketeerApp = lambda { |env|
[200, {"Content-Type" => "text/html"}, ["javascripts"]]
}
默认路由:
Ruby代码
# Rails3:
match '/:controller(/:action(/:id))'
# Rails2:
map.connect ':controller/:action/:id'
正则路由:
Ruby代码
# Rails3:
match 'products/:id', :to => 'catalog#view'
# Rails2:
map.connect 'products/:id', :controller => 'catalog', :action => 'view'
命名路由:
Ruby代码
# Rails3:
match 'logout', :to => 'sessions#destroy', :as => 'logout'
# Rails2:
map.logout 'logout', :controller => 'sessions', :action => ''
根路由:
Ruby代码
# Rails3:
root => 'welcome#show'
# Rails2:
map.root :controller => 'welcome', :action => 'show'
路由简写技巧:
:to 键的省略:
Ruby代码
match 'account' => 'account#index'
# 相当于:
match 'account', :to => 'account#index'
match 'info' => 'projects#info', :as => 'info'
注意:
:as 在rails3中是改变 helper, 在rails2中是改变 path
当路径和控制器(及action)一至时,可省略指派控制器部分
Ruby代码
match 'account/overview'
# 相当于:
match 'account/overview', :to => 'account#overview'
Verb路由
当需要限制http请求方法的时候通过键 :via ,也可以直接把方法写在最前面:
Ruby代码
get 'account/overview'
# 相当于:
match 'account/overview', :via => 'get'
match 'account/setup', :via => [:get, :post]
# 支持get\post\put\delete四种HTTP方法
resources路由:
Ruby代码
resources :posts, :except => [:index]
resources :posts,nly => [:new, :create]
# edit_post GET /posts/:id/modify(.:format) {:controller=>"posts", :action=>"edit"}
resources :posts, :path_names => { :edit => 'modify' }
resources :projects do
resources :tasks, :people
end
resources :products do
collection do
get :sold
postn_offer, :search
end
get :buy,n => :member
post :batch,n => :collection
end
resource :session do
get :create
end
:shallow用法:
Rails3中的shallow用法与Rails2中一致
Ruby代码
resources :blogs, :shallow => true do
resources :comments
end
使用:shallow前后相同部分:
blog_comments GET /blogs/:blog_id/comments(.:format) {:controller=>"comments", :action=>"index"}
blog_comments POST /blogs/:blog_id/comments(.:format) {:controller=>"comments", :action=>"create"}
new_blog_comment GET /blogs/:blog_id/comments/new(.:format) {:controller=>"comments", :action=>"new"}
blogs GET /blogs(.:format) {:controller=>"blogs", :action=>"index"}
blogs POST /blogs(.:format) {:controller=>"blogs", :action=>"create"}
new_blog GET /blogs/new(.:format) {:controller=>"blogs", :action=>"new"}
edit_blog GET /blogs/:id/edit(.:format) {:controller=>"blogs", :action=>"edit"}
blog GET /blogs/:id(.:format) {:controller=>"blogs", :action=>"show"}
blog PUT /blogs/:id(.:format) {:controller=>"blogs", :action=>"update"}
blog DELETE /blogs/:id(.:format) {:controller=>"blogs", :action=>"destroy"}
使用:shallow前后不同部分:
不使用shallow选项:
edit_blog_comment GET /blogs/:blog_id/comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"}
blog_comment GET /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"show"}
blog_comment PUT /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"update"}
blog_comment DELETE /blogs/:blog_id/comments/:id(.:format) {:controller=>"comments", :action=>"destroy"}
使用shallow选项后:
edit_comment GET /comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"}
comment GET /comments/:id(.:format) {:controller=>"comments", :action=>"show"}
comment PUT /comments/:id(.:format) {:controller=>"comments", :action=>"update"}
comment DELETE /comments/:id(.:format) {:controller=>"comments", :action=>"destroy"}
可以看出使用shallow选项后,对于已经存在的资源使用简化方式操作,具体行为涉及到 edit\show\update\destroy 四种
另外,shallow选项的有效范围是对自身及嵌套的资源都有效,如下面这个例子:
Ruby代码
resources :publishers do
resources :magazines do
resources :albums, :shallow => true do
resources :photos do
resources :images
end
end
end
end
这个例子中 albums、photos、images 都会使用简化方式,而 magazines 不会。特别注意:这种嵌套方式极不推荐,一般嵌套的层级最好不要超过一级
scope路由
:path 改变Path,:module 改变Controller, :name_prefix || :as 改变 helper
Ruby代码
scope 'admin' do
resources :posts
end
# 行当于:
scope :path => 'admin' do
resources :posts
end
生成路由:
posts GET /admin/posts(.:format) {:controller=>"posts", :action=>"index"}
posts POST /admin/posts(.:format) {:controller=>"posts", :action=>"create"}
new_post GET /admin/posts/new(.:format) {:controller=>"posts", :action=>"new"}
edit_post GET /admin/posts/:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
post GET /admin/posts/:id(.:format) {:controller=>"posts", :action=>"show"}
post PUT /admin/posts/:id(.:format) {:controller=>"posts", :action=>"update"}
post DELETE /admin/posts/:id(.:format) {:controller=>"posts", :action=>"destroy"}
Ruby代码
scope :module => 'admin' do
resources :posts
end
# 相当于:
resources :posts, :module => 'admin'
生成路由:
posts GET /posts(.:format) {:controller=>"admin/posts", :action=>"index"}
posts POST /posts(.:format) {:controller=>"admin/posts", :action=>"create"}
new_post GET /posts/new(.:format) {:controller=>"admin/posts", :action=>"new"}
edit_post GET /posts/:id/edit(.:format) {:controller=>"admin/posts", :action=>"edit"}
post GET /posts/:id(.:format) {:controller=>"admin/posts", :action=>"show"}
post PUT /posts/:id(.:format) {:controller=>"admin/posts", :action=>"update"}
post DELETE /posts/:id(.:format) {:controller=>"admin/posts", :action=>"destroy"}
Ruby代码
scope :name_prefix => 'admin' do
resources :posts
end
# 相当于:
resources :posts, :name_prefix => 'admin'
生成路由:
admin_posts GET /posts(.:format) {:controller=>"posts", :action=>"index"}
admin_posts POST /posts(.:format) {:controller=>"posts", :action=>"create"}
new_admin_post GET /posts/new(.:format) {:controller=>"posts", :action=>"new"}
edit_admin_post GET /posts/:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
admin_post GET /posts/:id(.:format) {:controller=>"posts", :action=>"show"}
admin_post PUT /posts/:id(.:format) {:controller=>"posts", :action=>"update"}
admin_post DELETE /posts/:id(.:format) {:controller=>"posts", :action=>"destroy"}
Ruby代码
scope 'admin', :module => 'admin', :name_prefix => 'admin' do
resources :posts
end
# 相当于:
namespace 'admin' do
resources :posts
end
生成路由:
admin_posts GET /admin/posts(.:format) {:controller=>"admin/posts", :action=>"index"}
admin_posts POST /admin/posts(.:format) {:controller=>"admin/posts", :action=>"create"}
new_admin_post GET /admin/posts/new(.:format) {:controller=>"admin/posts", :action=>"new"}
edit_admin_post GET /admin/posts/:id/edit(.:format) {:controller=>"admin/posts", :action=>"edit"}
admin_post GET /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"show"}
admin_post PUT /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"update"}
admin_post DELETE /admin/posts/:id(.:format) {:controller=>"admin/posts", :action=>"destroy"}
在路由中定义跳转:
Ruby代码
match "/posts/github" => redirect("http://github.com/rails.atom")
# 地址 /foo/1 会自动跳转到 /bar/1s
match "/foo/:id", :to => redirect("/bar/%{id}s")
# /account/proc/inosin 会自动跳转到 /inosins
match 'account/proc/:name', :to => redirect {|params|
"/#{params[:name].pluralize}" }
match "/stories" => redirect {|p, req| "/posts/#{req.subdomain}" }
路由中的限制:
Ruby代码
# 限制 id 只能为数字
match "/posts/show/:id", :to => "posts#index", :id => /\d+/
match "/posts/show/:id", :to => "posts#index", :constraints => {:id => /\d+/}
# 限制子域名
match "photos", :constraints => {:subdomain => "admin"}
# 限制访问者 IP
constraints(:ip => /127.0.0.1/) do
match '/questions', :to => redirect("http://www.stackoverflow.com/")
end
# 当访问者 ip 是 192.168.1.* 的来访者访问 子域名为 "test"
match "/ttt" => proc{|env| [200, {}, ["hello test"]]}, \
:constraints => {:subdomain => "test", :ip => /192\.168\.1\.\d+/}
路由通配符:
Ruby代码
resources :photos, :id => /\d+/
match 'photos/*other' => 'photos#unknown'
#上面这两行路由则会把不符合7种path的其他url全部解析到PhotoController#unknown中去处理,params[:other]可得到path中/photos/之后的部分,注意这两行的顺序不能颠倒
match 'books/*section/:title' => 'books#show'
# 例如:books/some/section/last-words-a-memoir 中 params[:section] = "some/section", params[:title] = "last-words-a-memoir".
match '*a/foo/*b' => 'test#index'
# 例如:zoo/woo/foo/bar/baz 中 params[:a] = "zoo/woo", params[:b] = "bar/baz"
Rack:
Ruby代码
match "/foo", :to => proc {|env| [200, {}, ["Hello world"]] }
match 'rocketeer.js' => ::TestRoutingMapper::RocketeerApp
RocketeerApp = lambda { |env|
[200, {"Content-Type" => "text/html"}, ["javascripts"]]
}
发表评论
-
install snipMate
2012-04-10 14:42 1003# install snipMate cd /tmp wget ... -
vim ruby 格式化代码
2012-04-10 14:39 12211)复制 /usr/share/vim/vim72/inden ... -
imagemagick rmagick
2011-11-13 20:46 12401. 安装ImageMagick:sudo apt-ge ... -
file path
2011-11-09 22:31 1047一直能看到一些gem里面会有这样一句代码: $:.unshif ... -
Useful Rails3 Commands – Cheatsheet
2011-11-04 11:39 880Some of useful Rails3 Commands ... -
ruby irb方向键 delete等
2011-11-01 13:45 951如果是ubuntu下面 apt-get install li ... -
Rspec
2011-10-31 21:07 719http://www.iteye.com/topic/1662 ... -
ruby发布gem包
2011-08-04 10:00 977uby中有很多插件以gem包 ... -
memoization 性能
2010-12-10 14:38 936http://rails-bestpractices.com/ ... -
ruby script/console readline报错
2010-11-17 16:30 1084/usr/local/lib/ruby/1.8/i686-li ... -
select_tag写法
2010-10-29 17:58 918<%= select_tag("artic ... -
rail链接oracle乱码
2010-10-13 15:11 865在environment.rb中 ENV['NLS_LANG ... -
ActionController::InvalidAuthenticityToken解决办法
2010-08-09 10:45 1018第一种: Ror代码 1. class FooCont ... -
安装curb
2010-07-05 09:17 1085如果gem intall curb失败了可以: wget h ... -
ruby 读取网上的文件
2010-06-04 10:13 1038require 'net/http' require ' ... -
rails jcode
2010-05-04 14:06 1129由于当前的ruby并不支持unicode, 所以中文相关的处理 ...
相关推荐
在Rails应用程序的根文件夹中,从命令行运行rails-route-checker 。 您也可以使用-c或--config标志来指定自定义配置文件。 默认情况下,该配置文件是在.rails-route-checker.yml 。 可以在下面找到有关配置文件的更...
route_translator, 将 Rails 应用程序路由转换为各种语言,无需担心 RouteTranslator RouteTranslator是一个 gem,允许你使用简单的字典格式管理应用程序路由的翻译。它以 fork Raúl Murciano 插件的一个插件插件的...
Rails3 是 Ruby on Rails 框架的一个版本,它提供了一系列强大的命令行工具,使得开发者可以快速地构建和管理Web应用。在本文中,我们将深入探讨Rails3中的常用命令,帮助你更高效地进行开发工作。 首先,新建一个...
《Rails 3 in Action》是2011年由Ryan Bigg撰写的一本关于Ruby on Rails框架的权威指南,专门针对当时最新的Rails 3.1版本进行了深入解析。这本书旨在帮助开发者充分利用Rails 3.1的强大功能,提升Web应用开发的效率...
《Ruby on Rails 3 Tutorial》是一本专门为初学者设计的指南,旨在帮助读者快速掌握Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby语言的一个开源框架,它采用MVC(Model-View-...
注意:实际上Rails 3推荐使用更高的版本,例如3.0或更高版本。不过为了保持与原始文件一致,这里仍采用2.3.11: ```bash gem install rails -v=2.3.11 ``` ##### 4. 安装Passenger Passenger是一个高效的Web...
在“Ruby Rails 3 Linda”这一主题中,我们将会深入探讨Rails 3版本的相关知识点。 1. **安装与设置**:首先,学习如何在本地环境中安装Ruby、RubyGems和Rails。Ruby版本管理器如RVM(Ruby Version Manager)或...
10. **Railscasts**:Ryan Bates的Railscasts系列教程在Rails 3时代发布了大量关于新特性和最佳实践的视频,帮助开发者快速掌握Rails 3的使用。 综上所述,"Ruby on Rails 3"结合Ruby 1.9.2的特性,为开发者提供了...
Ruby+on+Rails+3+Tutorial.pdf 应用Rails进行敏捷Web开发第4版.pdf (Agile Web Development with Rails) Rails.Recipes.Rails.3.Edition.pdf
turbo-sprockets-rails3, 加速你的Rails 3资产 用于 Rails 3.2.x的涡轮链轮 通过只根据源文件的哈希来重新编译已经更改的资产,从而加快 Rails 3 rake assets:precompile的速度只编译一次以生成指纹和非打印的资产...
Rails3消息队列系统 Sidekiq
### Ruby on Rails 3 教程知识点解析 #### 标题与描述中的核心知识点 - **Ruby on Rails 3**:一种流行的Web开发框架,基于Ruby语言。 - **经典教材**:表明本书是学习Ruby on Rails 3的一个权威且广受好评的资源...
rails3的英文文档
总的来说,了解和熟练掌握Rails 3.1和Cucumber-Rails 1.2.0的用法,对于任何希望在Ruby on Rails环境中进行高效、高质量开发的团队来说都是至关重要的。通过阅读相关的博客文章(如给出的链接),开发者可以深入学习...
针对使用Rails 3新特性的具体场景,手册提供了丰富的实用建议: - **代码重构技巧**:学习如何重构代码以充分利用Rails 3的新功能,例如ActiveRecord改进等。 - **最佳实践**:遵循最佳实践可以避免常见的陷阱,并使...
这个Rails项目提供了学习和研究Web开发的机会,特别是对于Ruby on Rails新手,可以通过阅读和理解源代码来提升技能,了解实际应用中Rails的用法。同时,对于有经验的开发者,这个项目也可以作为一个起点,进行二次...
有时候 rails 会出现: “No route matches”错误, 可以利用如下方法解决; 找到 config/routes.rb 文件, 打开编辑, 找到如下行: # See how all your routes lay out with “rake routes” 在这行下面添加一行, 内容...