One of the more recent developments with ruby on rails is called REST. REST is basically an expansion on the basics of CRUD. CRUD, if you don't know already, means Create, Read, Update, Destroy. Whenever you use scaffolding to create rails files, you automatically find things like create, show, update, and destroy. HTTP comes with PUT/GET/POST/DELETE, which equal CREATE/READ/UPDATE/DELETE. This is why when somebody posts a form to /user/1, it will update the value of user with id=1 - rails knows automatically that a 'post' request means you will be updating something.
RESTful development expands this, to also provide Index, New, and Edit. But REST is also a philosophy, in which adjectives (new,edit,index) are considered views, and verbs(create,read,update,destroy) are actions. Verbs come before the object id, and adjectives come after. Consider these restful URLs:
GET /profile/1 - renders a display of profile id=1
GET /profile/1/edit - renders a display of an edit form for profile=1 (notice that edit is an adjective, modifying what is displayed)
GET /profile/index - renders an index of profiles
POST /profile/1 - edits profile id=1
PUT /profile/ - creates a new profile
DELETE /profile/1 - deletes profile id=1
These 'routes' as the URLs are called in rails, are what make RESTful programming important. Basically it's more convention and less configuration. You automatically have index, new, edit, create, show, update, destroy all created automatically for you. If you need to do anything else, you can just add it yourself, but most people rarely deviate from these specifications.
You also get access to helpers, to generate paths for you. "" will generate a link to "/profile/1" pointing to the specific profile in the @profile variable. To have these automatically generated for you, open up routes.rb and add "map.resources :profiles" to the top. This will add these default URL specifications, giving you easy access to RESTful routes.
Published by Ryan Kopf
Ryan is a technologist and geek who organizes anime conventions through the magic of technology and an awesome team of evil super-villains. He graduated with an AA in 2008, is studied for a BA in computer sc... View profile
- Flex 2: Software Development Kit for Rich Internet Applications Aimed for Flash Pl...Flex 2 is a Rich Internet Application framework for building responsive Graphical User Interface (GUI) applications deployed on the Adobe Flash player plugin which is available in all modern A-grade browsers.
Starting Hobby Web DevelopmentFor many people, building websites is a great way to express creativity and get in touch with their inner nerd. If you're looking to get into web programming or design, here are...
- Ruby on Rails Hosting
- The Philosophy of Web Application Development with Ruby on Rails
- A Beginner's Guide to Learning Ruby on Rails
- Ruby Vs. Python as Programming Languages
- GoDaddy Shared Hosting Versus Private Server
- Band Tips: How to Plan a CD Release Show with Facebook
- What Are the Different Web Frameworks You Can Use with Web 2.0
- Ruby on Rails is flexible and cuts development time
- REST is one of the latest Rails features
- Convention makes for less time wasted configuring settings



