Resources in the 5--rails schema

Source: Internet
Author: User

Before we put the controller function is not accurate, corresponding resources can also be more common such as Weibo resources, news resources.

7 Common ways to access resources are index and other systems that help us name the default action

Create is the creation of a book, and new is the page that created it, which is then sent to create for creation, or create to complete

We should also name the Controller and action to match the above better.

Weibo applications definitely need resources, and this resource is fully responsible for the various access features of Weibo.

A controller often corresponds to a resource.

Create a Controller and action

Index gets all Weibo, create creates a Weibo, show displays the specified Weibo

To create a posts controller with 4 action, we use this controller to operate the corresponding posts resource.

We created the Weibo controller, but the resources are definitely empty, and we need to create resources with new and created.

After you create the controller and the action, then you go to change the route

We want to open Weibo and see all of our tweets, so we're going to have to route this to the Weibo homepage.

Switch

The results are as follows

?

?

?

?

?

Resources in the 5--rails schema

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.