`
hideto
  • 浏览: 2678395 次
  • 性别: 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 ...

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

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

    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 101 入门电子书

    《Rails 101 入门电子书》是一本非常适合初学者直接入门的书籍,它由xdite编写并出版于2014年6月10日。本书主要针对的是希望学习Ruby on Rails框架的读者,特别是那些想要从零开始掌握这项技术的新手。 #### 二、...

    rails和mysql数据库连接中出现的问题以及解决办法

    在开发Web应用时,Rails框架和MySQL数据库的集成是一个常见的选择。然而,有时在尝试连接Rails应用到MySQL数据库时,可能会遇到一些问题。本篇文章将深入探讨这些常见问题及其解决方案。 首先,Rails与MySQL的连接...

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

    rails2-sample

    从给定的文件信息来看,我们正在探讨的是一本关于Ruby on Rails的书籍,书名为《Simply Rails2》,作者是Patrick Lenz。本书旨在为初学者提供深入理解Ruby on Rails框架的指南,从基础概念到高级主题均有涵盖,是...

    NetBeans Ruby and Rails IDE with JRuby 2009

    总结来说,《NetBeans Ruby and Rails IDE with JRuby 2009》是一本详尽介绍了如何使用NetBeans作为Ruby和Rails开发工具的指南。它不仅覆盖了从安装到日常开发的所有方面,还深入探讨了如何利用NetBeans的各种高级...

    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