Home arrow Ruby-on-Rails arrow Page 4 - Ruby on Rails: Beginning Rails
RUBY-ON-RAILS

Ruby on Rails: Beginning Rails


In our last article I left you with a cliffhanger -- you learned to create a third of your first web application with Rails. If you are back here reading this article then my evil plot worked. In this episode we will continue building our first application in Rails and learn to create a basic skeletal framework.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
April 28, 2008
TABLE OF CONTENTS:
  1. · Ruby on Rails: Beginning Rails
  2. · Controlling the Situation
  3. · A View...To a Kill (Duhn Duhn Dun!!!)
  4. · What Everything is For

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Ruby on Rails: Beginning Rails - What Everything is For
(Page 4 of 4 )

Our Buddy the Controller

Our buddy the controller, as stated previously, is the foreman of your web application. He handles the requests sent from the user's web browser, such as a URL. It also directs people from page to page in your website. And lastly, the controller calls upon actions, then takes the result of that action and hands it on to a particular view.

The View...No, Not the Horrible Television Show

A view's function is pretty simple: display the results from an action. Keep in mind that there can be a plethora of views in a website, each triggered by a certain action. A good example of this is if you display a page asking a user for data through one action, then when the user enters that data, another action is called displaying a different view.

Do Your Thing, On the Runway

To handle the processing of data in your application, you need what is called a Model. Aside from looking really hot and being really dumb, models interact with actions and handle the data tasks for them.

Examples would be mathematical equations, checking to see whether a certain piece of data is in a database, copying information from one database to other databases, etc. The action gives data to the model, and the model returns some result to the action.

And there you have it folks...an explanation of what is known as the Model-View-Controller architecture.

Conclusion

We've covered a lot of ground in this tutorial. You learned how to build your first web app with Rails and how to set up your basic skeletal framework. Granted it was a cheesy static web page that was our result (whatchoo talk bout Willis?!?). But never fear. In our next exciting episode we will begin to work with more dynamic pages. You'll learn to do math, respond to user input and lots more. So be sure to come back often.

Till then...


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
RUBY-ON-RAILS ARTICLES

- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form
- Ruby on Rails Templates and Layouts
- Action Pack Controller Creation
- Writing an Action Pack Controller

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials