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.
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
MVC • Model-View-Control er • 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
MVC cont. • Browser sends a request for a page (i.e. /users/16) • Request gets received by server and passed onto a “control er” • A control er wil 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 control er wil then render a view
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 diﬀerent 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 diﬀerent payment gateways with very diﬀerent 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.