`
hideto
  • 浏览: 2652416 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

每天一剂Rails良药之Make your URLs Meaningful(and pretty)

    博客分类:
  • Ruby
阅读更多
这篇内容没什么价值,《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()方法,前者是绝对路径的链接,后者是相对路径的链接
分享到:
评论
2 楼 hideto 2007-08-01  
是的是的
1 楼 jonlove 2007-08-01  
<<Agile Rails>>
你是说的这本书?
Agile web development with rails?

相关推荐

    Rails.Angular.Postgres.and.Bootstrap.2nd.Edition

    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 ...

    Deploying.Rails.with.Docker.Kubernetes.and.ECS

    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 ...

    [Rails] Crafting Rails Applications (英文版)

    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的环境、初始过程、配置和日志记录,Rails的分配器、控制器、页面生成和路由,REST、资源和Rails,ActiveRecord的基础、关联、验证和高级技巧,...

    rails 5 test prescriptions build a healthy codebase

    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 ...

    The Rails3 Way, 2nd Edition

    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

    Build your own ruby on rails web application

    The Rails 3 Way(2nd)

    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 ...

    Rails 4 Test Prescriptions(Pragmatic,2014)

    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

    rails-angular-postgres-and-bootstrap-second-edition 英文原版

    Rails.Recipes(Rails.3.Edition,2012) 英文版PDF

    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....

    Agile Web Development with Rails 4

    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 on Rails_ Up and Running

    RUBY的经典之作,对其在RAILS下开发写得很详细

    Rails, Angular, Postgres, and Bootstrap(2nd)

    Rails, Angular, Postgres, and Bootstrap(2nd),电子书实战版

    Rails for .NET Developers

    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 ...

    Rails Recipes英文版(清晰文字pdf+源码)

    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

    Rails, Angular, Postgres, and Bootstrap(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Ajax on Rails

    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 ...

Global site tag (gtag.js) - Google Analytics