1.8. Summary

In this chapter, you start with nothing and finish with the beginnings of a recipe-sharing website. The initial data design sets the pattern for the remainder of the development.

REST is a structure for organizing web pages by resource, with a common set of commands for accessing the basic Create, Read, Update, Delete (CRUD) functionality for each resource. REST also allows for URL patterns to be common from resource to resource, and depends on the specific HTTP method of the request to determine what action the server should take in response to a URL.

Rails supports REST by easily scaffolding the creation of a REST model and its associated controller. A single element in the routes.rb file specifies an entire suite of RESTful routes for the resource. These routes can be seen using the rake routes command. Resources can be nested, in which case the child resource URLs always contain an instance of the parent resource.

The basic application is augmented in this chapter with some server-side intelligence to make entering data easier for the user. An in-place editor is added using basic Ajax techniques, and unit and functional tests are written for all new code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.94.84