为 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
相关推荐
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:...
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, ...
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.
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 课件
Beginning Rails 4
Ruby for Rails 英文原版, pdf格式 <br>本书是一部专门为Rails实践而写的经典Ruby著作,由四部分组成,共17章。第一部分讲述Ruby和Rails的编程环境。第二部分和第三部分与 Rails紧密联系,着重对Ruby这门语言...
Rails 4 Test Prescriptions.pdf
唔,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 test described by RSpec
Rails for Zombies. This is a tutorial of ruby on rails application.
[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, ...
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.
[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 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 的基本知识,...安装 ruby ,rails...mysql 数据库...用 rails 实现的是一个简单的网上书籍管理程序 ...
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, ...
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...