`
jiajie0531
  • 浏览: 27537 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

rails4 6.3 Adding a Route for Comments

阅读更多

为 Comments(评论) 增加一个路由

正如同 welcome的控制器一样,我们需要增加一个路由,以致于Rails会知道指向何处,让我们可以看到 comments。再一次打开配置文件  config/routes.rb,参照下面这样编辑:

resources :articlesdo

  resources :comments

end

在articles内创建了一个内嵌的资源comments. 这是涉及到继承关联性的另一个部分,存在于 articles 和 comments之间。

p.s. 想要了解更多的关于路由的信息,可以参考 Rails Routing 

 

original text: http://guides.rubyonrails.org/getting_started.html#adding-a-route-for-comments

 

— end

0
0
分享到:
评论

相关推荐

    Bootstrap for Rails (2015)

    Summary 94 Chapter 6: Creating Navigation Bars 95 Getting started with a navigation bar 95 Navigation bar helper classes 102 Adding a navigation bar to the Rails application 103 Summary 105 Chapter 7:...

    Rails 4 in Action(Manning,2015)

    Now in version 4, Rails is mature and powerful, and to use it effectively you need more than a few Google searches. You'll find no substitute for the guru's-eye-view of design, testing, deployment, ...

    Agile Web Development with Rails 4

    Ruby on Rails helps you ... Additionally, this edition now works on Ruby 2.0, a new release of Ruby with substantial functional and performance improvements., This edition is for Rails4.0 and beyond.

    Rails for .NET Developers

    For a .NET developer, learning Rails is as much about the cultural and philosophical shifts in thinking as it is about the technical learning curve. In this book, we hope to break down some of these ...

    rails for zombies

    rails for zombies 课件

    Beginning Rails 4

    Beginning Rails 4

    Ruby for Rails

    Ruby for Rails 英文原版, pdf格式 <br>本书是一部专门为Rails实践而写的经典Ruby著作,由四部分组成,共17章。第一部分讲述Ruby和Rails的编程环境。第二部分和第三部分与 Rails紧密联系,着重对Ruby这门语言...

    Rails 4 Test Prescriptions.pdf

    Rails 4 Test Prescriptions.pdf

    Rails 4 in Action

    唔,1分应该还是有人下的吧,共同学习进步,Ruby on Rails is an open source web framework.... "Rails 4 in Action" is a fully-revised second edition of "Rails 3 in Action." This hands-on, compreh...

    Rails 4 Test Prescriptions

    Rails test described by RSpec

    Rails for Zombies

    Rails for Zombies. This is a tutorial of ruby on rails application.

    [Rails] Crafting Rails Applications (英文版)

    [Pragmatic Bookshelf] Crafting Rails Applications Expert Practices for Everyday Rails Development (E-Book) ☆ 图书概要:☆ Rails 3 is a huge step forward. You can now easily extend the framework, ...

    Addison.Wesley.RailsSpace.Building.a.Social.Networking.Website.with.Ruby.on.Rails

    RailsSpace teaches you Ruby on Rails by developing a real-world application: Rails...designed to show how to use Rails to make a web application suitable for deployment into a production environment.

    [Rails] Crafting Rails 4 Applications (英文版)

    [Pragmatic Bookshelf] Crafting Rails 4 Applications Expert Practices for Everyday Rails Development (E-Book) ☆ 图书概要:☆ Get ready to see Rails as you've never seen it before. Learn how to ...

    Rails 4 in Action, Second Edition.pdf

    Rails 4 in Action, Second Edition.pdf

    Rails 4 Test Prescriptions(Pragmatic,2014)

    Rails 4 Test Prescriptions is a comprehensive guide to how tests can help you design and write better Rails applications. In this completely revised edition, you'll learn why testing works and how to...

    Ruby+for+Rails

    Ruby 的基本知识,...安装 ruby ,rails...mysql 数据库...用 rails 实现的是一个简单的网上书籍管理程序 ...

    rails 5 test prescriptions build a healthy codebase

    You need test-driven development: a process for improving the design, maintainability, and long-term viability of software. With both practical code examples and discussion of why testing works, ...

    Rails.5.Revealed.For.those.Upgrading.to.Version.5

    The headline features, Rails API and ActionCable, are each looked at in detail, building small example projects to demonstrate how to build a JSON API, add real-time notifications to a page and how to...

Global site tag (gtag.js) - Google Analytics