What is Rails?Rails is a web application development frameworkwritten in the Ruby language. It is designed tomake programming web applications easier bymaking assumptions about what every developerneeds to get started.Friday, 17 May 13
Rails Concepts• DRY - “Don’t Repeat Yourself”• Convention Over Conﬁguration• REST (CRUD)• MVC• Don’t Repeat YourselfFriday, 17 May 13
CRUD & RESTCRUD stands for create,read, update and destroy.REST stands for Representational State Transfer and is basically anexpansion of CRUD.REST uses resource identiﬁers such as URLs to represent resources.Example HTTP request:DELETE /users/1User resource with an id of 1, desired action - deleteFriday, 17 May 13
MVC• Model-View-Controller• Separates “business logic” from presentationlogic• “Business logic” typically consists of datamodels for resources (Users, Photos etc)• Presentation logic associated with a GUI - webpagesFriday, 17 May 13
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 getsconverted to HTML) or interact with a “model”.• Models are ruby objects that represents a resource and communicate with adatabase• After interacting with a model, the controller will then render a viewFriday, 17 May 13
GemsA gem is a packaged Ruby application or library. It has a name (e.g. rails)and a version (e.g. 3.2.1).Examples:OmniAuthOmniAuth is a Ruby authentication framework that provides a standardized interface to many differentauthentication providers such as Facebook, OpenID, and even traditional username and password.CarrierWaveUpload files in your Ruby applications, map them to a range of ORMs, store them on diﬀerent backends. It workswell with Rack based web applications, such as Ruby on Rails.Active MerchantActive Merchant is an extraction from the e-commerce system Shopify. Shopify’s requirements for a simple andunified API to access dozens of diﬀerent payment gateways with very diﬀerent internal APIs was the chief principlein designing the library. It was developed for usage in Ruby on Rails web applications and integrates seamlessly asa plugin but it also works excellently as a stand alone library.Friday, 17 May 13
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.