这篇内容没什么价值,《Agile Rails》里的Routing Request一节讲述的比较详细了
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/service.wsdl', :action => 'wsd'
map.connect ':controller/:action/:id'
map.connect ':user', :controller=> 'recipes',
:action => 'list',
:filter => 'user'
其实上面的代码是调用map.connect()方法:
map.connect(String path, Hash options)
再就是Named Routes:
map.popular 'popular/:tag', :controller => 'recipes',
:action => 'list',
:tag => '',
:filter => 'popular'
这会生成popular_url()和popular_path()方法,前者是绝对路径的链接,后者是相对路径的链接
分享到:
相关推荐
Achieve awesome user experiences and performance with simple, maintainable code! Embrace the full stack of web development, from styling with Bootstrap, building an interactive user interface with ...
This concise teaches you how to use the power of Docker and Kubernetes to deploy your Rails applications easily and efficiently. Docker and Kubernetes are increasing in popularity every day, but what ...
This pioneering book is the first resource that deep dives into the new Rails 3 APIs and shows you how use them to write better web applications and make your day-to-day work with Rails more ...
《Rails之道》按照Rails的各个子系统进行组织编排,分别介绍了Rails的环境、初始过程、配置和日志记录,Rails的分配器、控制器、页面生成和路由,REST、资源和Rails,ActiveRecord的基础、关联、验证和高级技巧,...
Your Ruby on Rails application is sick. Deadlines are looming, but every time you make the slightest change to the code, something else breaks. Nobody remembers what that tricky piece of code was ...
Drawing on their unsurpassed experience and track record, they address the real challenges development teams face, showing how to use Rails 3 to maximize your productivity. Using numerous detailed ...
Build your own ruby on rails web application
along with the idioms, design approaches, and libraries that make developing applications with Rails so powerful. Drawing on their unsurpassed experience and track record, they address the real ...
Does your Rails code suffer from bloat, brittleness, or inaccuracy? Cure these problems with a regular dose of test-driven development. Rails 4 Test Prescriptions is a comprehensive guide to how tests...
rails-angular-postgres-and-bootstrap-second-edition 英文原版
In addition, you’ll find half the book is stocked with new eye-opening solutions to such common problems as how to extend Rails, test and deploy your sites, or add a web service to your actions....
You concentrate on creating the application, and Rails takes care of the details., Tens of thousands of developers have used this award-winning book to learn Rails. It’s a broad, far-reaching ...
RUBY的经典之作,对其在RAILS下开发写得很详细
Rails, Angular, Postgres, and Bootstrap(2nd),电子书实战版
source projects, Rails has been most easily adopted by individuals and organizations already immersed in the open source community. That means, as a Microsoft developer, you face unique challenges ...
Ruby三神书之一(其余的两本是Agile.Web.Development.with.Rails和Ruby For Rails,在我的资源列表也有) Rails is large, powerful, and new. How do you use it effectively? How do you harness the power? And, ...
Rails, Angular, Postgres, and Bootstrap(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
If you've already started working with Rails and seek to deepen your skill set, you'll find dozens of examples drawn from real-world projects, exhaustive reference for every relevant feature, and ...