2. What is Rails?
Rails is a web application development framework
written in the Ruby language. It is designed to
make programming web applications easier by
making assumptions about what every developer
needs to get started.
Friday, 17 May 13
4. CRUD & REST
CRUD stands for create,read, update and destroy.
REST stands for Representational State Transfer and is basically an
expansion of CRUD.
REST uses resource identifiers such as URLs to represent resources.
Example HTTP request:
DELETE /users/1
User resource with an id of 1, desired action - delete
Friday, 17 May 13
5. MVC
• Model-View-Controller
• Separates “business logic” from presentation
logic
• “Business logic” typically consists of data
models for resources (Users, Photos etc)
• Presentation logic associated with a GUI - web
pages
Friday, 17 May 13
6. MVC cont.
• Browser sends a request for a page (i.e. /users/16)
• Request gets received by server and passed onto a “controller”
• A controller will either immediately render a “view” (template that gets
converted to HTML) or interact with a “model”.
• Models are ruby objects that represents a resource and communicate with a
database
• After interacting with a model, the controller will then render a view
Friday, 17 May 13
14. Gems
A gem is a packaged Ruby application or library. It has a name (e.g. rails)
and a version (e.g. 3.2.1).
Examples:
OmniAuth
OmniAuth is a Ruby authentication framework that provides a standardized interface to many different
authentication providers such as Facebook, OpenID, and even traditional username and password.
CarrierWave
Upload files in your Ruby applications, map them to a range of ORMs, store them on different backends. It works
well with Rack based web applications, such as Ruby on Rails.
Active Merchant
Active Merchant is an extraction from the e-commerce system Shopify. Shopify’s requirements for a simple and
unified API to access dozens of different payment gateways with very different internal APIs was the chief principle
in designing the library. It was developed for usage in Ruby on Rails web applications and integrates seamlessly as
a plugin but it also works excellently as a stand alone library.
Friday, 17 May 13