Ruby on Rails is an open-source web application framework that uses the Model-View-Controller pattern. It uses Ruby as its programming language. Rails provides conventions for building database-backed web applications, including scaffolding that automatically generates the basic structure and files needed for a model. Rails emphasizes conventions over configuration, including naming conventions and default directory structures. The document provides an overview of Rails and demonstrates how to generate a sample bookmarks application using Rails, including generating models, views, controllers, and associations between models.
Laravel Framework is a popular PHP framework that is taking the web development community by storm. Laravel is the Most Starred PHP Framework on Github: more than 30 000 developers from all over the world (mostly from the USA) use it for custom software development.
Turbocharge your web development with Rails
Vagmi Mudumbai presented an overview of Ruby on Rails web development. The presentation covered installing Ruby and Rails, the MVC framework, generating models and migrations, querying the database, controllers and routes, views and forms. Attendees learned the basics of building a Rails application including setting up models, controllers and views to create, read, update and delete data through a RESTful interface.
This document summarizes the Rails request lifecycle and describes various middlewares used in Rails. It begins by explaining what a request is and how it travels from the browser to the Rails application. It then discusses the roles of the web server and app server. The bulk of the document describes each middleware in the Rails stack, from Rack middlewares to ActionDispatch middlewares to ActiveRecord middlewares. It explains what each middleware does to filter requests and responses. Finally, it outlines how the request travels through the middleware stack to the routes, controller, and back out again to complete the response sent to the client.
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
Apache Jackrabbit is just about to reach the 3.0 milestone based on a new architecture called Oak. Based on concepts like eventual consistency and multi-version concurrency control, and borrowing ideas from distributed version control systems and cloud-scale databases, the Oak architecture is a major leap ahead for Jackrabbit. This presentation describes the Oak architecture and shows what it means for the scalability and performance of modern content applications. Changes to existing Jackrabbit functionality are described and the migration process is explained.
The document discusses two Ruby gems, Ashikawa::Core and Ashikawa::AR, that provide an interface to the ArangoDB database. Ashikawa::Core provides a low-level driver that abstracts ArangoDB's REST interface, while Ashikawa::AR implements an Active Record pattern for integrating ArangoDB with Rails applications. The document also briefly mentions plans to develop a DataMapper interface (Ashikawa::DataMapper) to support various data sources including ArangoDB.
This are the slides of my talk: "Building a SPA in 30 min" given at NoSQL Matters CGN 2014.
It is about the creation of a backend for a Single Page Web Application build in AngularJS. The Backend is build in Foxx on top of ArangoDB, a framework to create a RESTful backend with only a few lines of Code.
Laravel Framework is a popular PHP framework that is taking the web development community by storm. Laravel is the Most Starred PHP Framework on Github: more than 30 000 developers from all over the world (mostly from the USA) use it for custom software development.
Turbocharge your web development with Rails
Vagmi Mudumbai presented an overview of Ruby on Rails web development. The presentation covered installing Ruby and Rails, the MVC framework, generating models and migrations, querying the database, controllers and routes, views and forms. Attendees learned the basics of building a Rails application including setting up models, controllers and views to create, read, update and delete data through a RESTful interface.
This document summarizes the Rails request lifecycle and describes various middlewares used in Rails. It begins by explaining what a request is and how it travels from the browser to the Rails application. It then discusses the roles of the web server and app server. The bulk of the document describes each middleware in the Rails stack, from Rack middlewares to ActionDispatch middlewares to ActiveRecord middlewares. It explains what each middleware does to filter requests and responses. Finally, it outlines how the request travels through the middleware stack to the routes, controller, and back out again to complete the response sent to the client.
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
Apache Jackrabbit is just about to reach the 3.0 milestone based on a new architecture called Oak. Based on concepts like eventual consistency and multi-version concurrency control, and borrowing ideas from distributed version control systems and cloud-scale databases, the Oak architecture is a major leap ahead for Jackrabbit. This presentation describes the Oak architecture and shows what it means for the scalability and performance of modern content applications. Changes to existing Jackrabbit functionality are described and the migration process is explained.
The document discusses two Ruby gems, Ashikawa::Core and Ashikawa::AR, that provide an interface to the ArangoDB database. Ashikawa::Core provides a low-level driver that abstracts ArangoDB's REST interface, while Ashikawa::AR implements an Active Record pattern for integrating ArangoDB with Rails applications. The document also briefly mentions plans to develop a DataMapper interface (Ashikawa::DataMapper) to support various data sources including ArangoDB.
This are the slides of my talk: "Building a SPA in 30 min" given at NoSQL Matters CGN 2014.
It is about the creation of a backend for a Single Page Web Application build in AngularJS. The Backend is build in Foxx on top of ArangoDB, a framework to create a RESTful backend with only a few lines of Code.
This document summarizes a presentation about using Eloquent ORM in Laravel. It introduces Laravel's database components including Query Builder, Eloquent ORM, and migrations. It describes how to define Laravel models and relationships. Pros and cons of Eloquent are listed. The workflow of defining models and relationships is outlined. There is a section on demoing raw SQL, Query Builder and Eloquent. Recommended learning materials on the topic are provided at the end.
The document discusses various customization options available in Vibe, including simple out-of-the-box customizations that require no coding like branding, forms, workflows, and templates. It also covers customization options that involve basic HTML, CSS, JavaServer Pages (JSP), and other development options using technologies like SOAP and applications. Specific customization examples provided include modifying styles, creating new forms and landing pages, and developing custom actions for workflows using Java classes.
This document provides an overview of Ruby on Rails, a web application framework written in Ruby. It discusses what Ruby and Rails are, the key strengths of Rails like productivity and convention over configuration. It then demonstrates how to build a basic Rails application, including generating models and controllers, scaffolding, and adding relationships between models. The document aims to introduce developers to Ruby on Rails and demonstrate its capabilities.
CakePHP is a free and open-source rapid application development (RAD) framework for PHP that provides a structured and rapid way for programmers to create web applications without loss of flexibility. It takes the monotony out of web development by providing features like an active community, flexible licensing, MVC architecture, code generation, and database integration through its model-view-controller structure. To use CakePHP, one would download the CakePHP package, extract it to their web server's directory, create the database and application models/controllers/views following CakePHP's conventions, and then access the application.
CakePHP is a free and open-source rapid application development (RAD) framework for PHP that provides a structured and rapid way for programmers to create web applications without loss of flexibility. It takes the monotony out of web development by providing features like an active community, flexible licensing, MVC architecture, code generation, and database integration through its model-view-controller structure. To use CakePHP, one would download the CakePHP package, extract it to their web server's directory, create the database and application models/controllers/views following CakePHP's conventions, and then access the application.
Ember.js is a client-side MVC JavaScript framework for building single-page web applications. It uses conventions over configurations and has components like routers, controllers, templates, and models. The router maps application state to URLs, controllers present data to views, templates render markup, and models store and retrieve data. Components allow creating reusable controls to simplify templates.
CouchDB is a document-oriented NoSQL database that uses JavaScript for querying. It stores data as JSON documents without a predefined schema and uses MapReduce functions for queries. Documents can be inserted and queried via a REST API. Views allow querying documents by indexing them with keys generated by map functions. Queries run against views to search indexed keys in various ways.
This document summarizes a presentation about using the HBase database with Ruby on Rails applications. It discusses what HBase is, some of the tradeoffs it involves compared to relational databases, when it may be suitable versus not suitable for an application, and how to interface with it from Rails. Examples are provided of libraries that can be used to connect Rails and HBase, as well as demos of JRuby scripts and Rails code that access an HBase backend.
This document discusses using the HBase database with Ruby on Rails applications. It provides an overview of HBase, including what it is, its core concepts like tables, columns, and column families. It also covers some of HBase's tradeoffs compared to relational databases, such as limitations on real-time queries and joins. The document discusses when HBase may be a good fit, such as for large datasets or highly distributed applications, and libraries for integrating HBase into Rails like hbase-stargate and MassiveRecord. It concludes with a demo of a URL shortener application built on Rails and HBase.
Responsive images are crucial to delivering stunning responsive web sites. Now that the <picture> element and srcset feature have found their way into every browser with to a certain degree following a common standard, there is no excuse for refusing to add art-directed responsive images to your grunt, gulp or webpack build flow or backend CMS/blog. This talk will explore the state of the art in building art-directed responsive images and will showcase several tools and techniques that web designers can use to automate art-directed responsive images.
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...J V
Alfresco Summit 2014 (London)
Though best practice is to leverage Alfresco through the well defined API's, it can be useful to understand the internals of the repository so that your development efforts are the most effective. A deep understanding of the repository will help you to evaluate performance bottlenecks, look for bugs, or make contributions. This session provides an overview of the repository internals, including the major components, the key services, subsystems, and database. We then provide an example where we leverage the repository in a micro-service architecture while building Alfresco's future cloud products and show how the different parts of the repository interact to fulfill requests.
http://summit.alfresco.com/london/sessions/diving-deep-alfresco-repository
https://www.youtube.com/watch?v=TAE9UjC0xxc
Apache Jackrabbit is an open source content repository for Java that provides a hierarchical content storage and full text search, versioning, and transactions capabilities, and serves as a reference implementation for the JSR 170 specification; it was originally developed by Day Software and later became an Apache project in 2004, and has since graduated from the Apache incubator with over 17 contribution components and an active community of developers and users.
Introduction to Akka-streams and Akka-http.
We show how simple it becomes to build an application that streams geolocated events in a time-consistent way on a websocket, with back-pressure propagated to the upstream.
Code can be found at
https://github.com/pierangeloc/reactive-earthquakes
Technical overview of three of the most representative KeyValue Stores: Cassandra, Redis and CouchDB. Focused on Ruby and Ruby on Rails developement, this talk shows how to solve common problems, the most popular libraries, benchmarking and the best use case for each one of them.
This talk was part of the Conferencia Rails 2009, Madrid, Spain.
http://app.conferenciarails.org/talks/43-key-value-stores-conviertete-en-un-jedi-master
Let’s face it, when was the last time you opened a command prompt as part of your daily routine? Did you know you can save a lot of time by creating scripts that automate your daily tasks, such as altering your application’s configuration files and then deploy the application to a remote server? There are developers that still think that scripting is the IT department’s domain. But Windows PowerShell is a different story. PowerShell is a scripting language that is more coding than scripting, mostly because its commands return objects, not text.
In this session we will learn what PowerShell is, the basics of coding with it, and how to call it from your .NET code. Most of the session will focus on how developers can benefit from using PowerShell in their day-to-day routine in order to work with XML and JSON, automate deployments, manage certificates, call HTTP services, manipulate file content, and more. Next time you are asked to deploy your application to the server, type, don’t click!
This document discusses using APEX Nitro to improve the APEX development process. APEX Nitro allows developers to write CSS and JavaScript locally and have changes automatically synced to their APEX application. It provides features like error handling, minification, concatenation, and preprocessing to boost performance and maintainability. The document reviews how to install, configure, and use APEX Nitro to enhance the front-end development experience.
Speed Up Your APEX Apps with JSON and HandlebarsMarko Gorički
The document discusses various methods for generating JSON from SQL queries in Oracle APEX applications. It compares manually concatenating strings, using the apex_util.json_from_* procedures, the PL/JSON library, the APEX_JSON API package, and Oracle REST Data Services (ORDS). The APEX_JSON package is recommended for most cases as it supports generation and parsing, can be used standalone, has a light footprint, and makes conversion from XML easy. Using a templating engine like Handlebars.js with JSON is also presented as a way to dynamically render HTML from database queries.
Ruby on Rails is a full-stack web application framework written in Ruby. It allows developers to build database-backed web applications rapidly using conventions like MVC pattern and follows "convention over configuration" principle. Rails includes features like Active Record (ORM), validations, migrations, scaffolding, routing and helpers to help develop web applications quickly. Testing is an important part of Rails development using tools like RSpec, Factory Girl, Cucumber and Capybara.
Ruby on Rails is a full-stack web application framework written in Ruby. It uses the MVC pattern and convention over configuration principles. Rails makes it possible to develop database-backed web applications rapidly by minimizing configuration through conventions and providing scaffolding. Key Rails concepts include Active Record for ORM, migrations for schema changes, routing for URLs, controllers for application logic, views for presentation, and testing frameworks. Rails emphasizes productivity through conventions that reduce configuration overhead.
This document summarizes a presentation about using Eloquent ORM in Laravel. It introduces Laravel's database components including Query Builder, Eloquent ORM, and migrations. It describes how to define Laravel models and relationships. Pros and cons of Eloquent are listed. The workflow of defining models and relationships is outlined. There is a section on demoing raw SQL, Query Builder and Eloquent. Recommended learning materials on the topic are provided at the end.
The document discusses various customization options available in Vibe, including simple out-of-the-box customizations that require no coding like branding, forms, workflows, and templates. It also covers customization options that involve basic HTML, CSS, JavaServer Pages (JSP), and other development options using technologies like SOAP and applications. Specific customization examples provided include modifying styles, creating new forms and landing pages, and developing custom actions for workflows using Java classes.
This document provides an overview of Ruby on Rails, a web application framework written in Ruby. It discusses what Ruby and Rails are, the key strengths of Rails like productivity and convention over configuration. It then demonstrates how to build a basic Rails application, including generating models and controllers, scaffolding, and adding relationships between models. The document aims to introduce developers to Ruby on Rails and demonstrate its capabilities.
CakePHP is a free and open-source rapid application development (RAD) framework for PHP that provides a structured and rapid way for programmers to create web applications without loss of flexibility. It takes the monotony out of web development by providing features like an active community, flexible licensing, MVC architecture, code generation, and database integration through its model-view-controller structure. To use CakePHP, one would download the CakePHP package, extract it to their web server's directory, create the database and application models/controllers/views following CakePHP's conventions, and then access the application.
CakePHP is a free and open-source rapid application development (RAD) framework for PHP that provides a structured and rapid way for programmers to create web applications without loss of flexibility. It takes the monotony out of web development by providing features like an active community, flexible licensing, MVC architecture, code generation, and database integration through its model-view-controller structure. To use CakePHP, one would download the CakePHP package, extract it to their web server's directory, create the database and application models/controllers/views following CakePHP's conventions, and then access the application.
Ember.js is a client-side MVC JavaScript framework for building single-page web applications. It uses conventions over configurations and has components like routers, controllers, templates, and models. The router maps application state to URLs, controllers present data to views, templates render markup, and models store and retrieve data. Components allow creating reusable controls to simplify templates.
CouchDB is a document-oriented NoSQL database that uses JavaScript for querying. It stores data as JSON documents without a predefined schema and uses MapReduce functions for queries. Documents can be inserted and queried via a REST API. Views allow querying documents by indexing them with keys generated by map functions. Queries run against views to search indexed keys in various ways.
This document summarizes a presentation about using the HBase database with Ruby on Rails applications. It discusses what HBase is, some of the tradeoffs it involves compared to relational databases, when it may be suitable versus not suitable for an application, and how to interface with it from Rails. Examples are provided of libraries that can be used to connect Rails and HBase, as well as demos of JRuby scripts and Rails code that access an HBase backend.
This document discusses using the HBase database with Ruby on Rails applications. It provides an overview of HBase, including what it is, its core concepts like tables, columns, and column families. It also covers some of HBase's tradeoffs compared to relational databases, such as limitations on real-time queries and joins. The document discusses when HBase may be a good fit, such as for large datasets or highly distributed applications, and libraries for integrating HBase into Rails like hbase-stargate and MassiveRecord. It concludes with a demo of a URL shortener application built on Rails and HBase.
Responsive images are crucial to delivering stunning responsive web sites. Now that the <picture> element and srcset feature have found their way into every browser with to a certain degree following a common standard, there is no excuse for refusing to add art-directed responsive images to your grunt, gulp or webpack build flow or backend CMS/blog. This talk will explore the state of the art in building art-directed responsive images and will showcase several tools and techniques that web designers can use to automate art-directed responsive images.
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...J V
Alfresco Summit 2014 (London)
Though best practice is to leverage Alfresco through the well defined API's, it can be useful to understand the internals of the repository so that your development efforts are the most effective. A deep understanding of the repository will help you to evaluate performance bottlenecks, look for bugs, or make contributions. This session provides an overview of the repository internals, including the major components, the key services, subsystems, and database. We then provide an example where we leverage the repository in a micro-service architecture while building Alfresco's future cloud products and show how the different parts of the repository interact to fulfill requests.
http://summit.alfresco.com/london/sessions/diving-deep-alfresco-repository
https://www.youtube.com/watch?v=TAE9UjC0xxc
Apache Jackrabbit is an open source content repository for Java that provides a hierarchical content storage and full text search, versioning, and transactions capabilities, and serves as a reference implementation for the JSR 170 specification; it was originally developed by Day Software and later became an Apache project in 2004, and has since graduated from the Apache incubator with over 17 contribution components and an active community of developers and users.
Introduction to Akka-streams and Akka-http.
We show how simple it becomes to build an application that streams geolocated events in a time-consistent way on a websocket, with back-pressure propagated to the upstream.
Code can be found at
https://github.com/pierangeloc/reactive-earthquakes
Technical overview of three of the most representative KeyValue Stores: Cassandra, Redis and CouchDB. Focused on Ruby and Ruby on Rails developement, this talk shows how to solve common problems, the most popular libraries, benchmarking and the best use case for each one of them.
This talk was part of the Conferencia Rails 2009, Madrid, Spain.
http://app.conferenciarails.org/talks/43-key-value-stores-conviertete-en-un-jedi-master
Let’s face it, when was the last time you opened a command prompt as part of your daily routine? Did you know you can save a lot of time by creating scripts that automate your daily tasks, such as altering your application’s configuration files and then deploy the application to a remote server? There are developers that still think that scripting is the IT department’s domain. But Windows PowerShell is a different story. PowerShell is a scripting language that is more coding than scripting, mostly because its commands return objects, not text.
In this session we will learn what PowerShell is, the basics of coding with it, and how to call it from your .NET code. Most of the session will focus on how developers can benefit from using PowerShell in their day-to-day routine in order to work with XML and JSON, automate deployments, manage certificates, call HTTP services, manipulate file content, and more. Next time you are asked to deploy your application to the server, type, don’t click!
This document discusses using APEX Nitro to improve the APEX development process. APEX Nitro allows developers to write CSS and JavaScript locally and have changes automatically synced to their APEX application. It provides features like error handling, minification, concatenation, and preprocessing to boost performance and maintainability. The document reviews how to install, configure, and use APEX Nitro to enhance the front-end development experience.
Speed Up Your APEX Apps with JSON and HandlebarsMarko Gorički
The document discusses various methods for generating JSON from SQL queries in Oracle APEX applications. It compares manually concatenating strings, using the apex_util.json_from_* procedures, the PL/JSON library, the APEX_JSON API package, and Oracle REST Data Services (ORDS). The APEX_JSON package is recommended for most cases as it supports generation and parsing, can be used standalone, has a light footprint, and makes conversion from XML easy. Using a templating engine like Handlebars.js with JSON is also presented as a way to dynamically render HTML from database queries.
Ruby on Rails is a full-stack web application framework written in Ruby. It allows developers to build database-backed web applications rapidly using conventions like MVC pattern and follows "convention over configuration" principle. Rails includes features like Active Record (ORM), validations, migrations, scaffolding, routing and helpers to help develop web applications quickly. Testing is an important part of Rails development using tools like RSpec, Factory Girl, Cucumber and Capybara.
Ruby on Rails is a full-stack web application framework written in Ruby. It uses the MVC pattern and convention over configuration principles. Rails makes it possible to develop database-backed web applications rapidly by minimizing configuration through conventions and providing scaffolding. Key Rails concepts include Active Record for ORM, migrations for schema changes, routing for URLs, controllers for application logic, views for presentation, and testing frameworks. Rails emphasizes productivity through conventions that reduce configuration overhead.
Rails is a web application framework written in Ruby that makes programming web applications easier. The key principles of Rails are DRY (Don't Repeat Yourself), convention over configuration, and using RESTful architecture. Rails uses the MVC pattern with models representing data, views representing the user interface, and controllers handling requests and passing data between models and views. Creating a Rails application involves generating the app, setting up the database schema through migrations, and using validations and callbacks to control object state changes.
This document provides a fast-paced introduction to Ruby, Rails, and additional technologies. It begins with an overview of Ruby basics, syntax, and uses beyond scripts. It then covers Rails fundamentals including MVC architecture, scaffolding, models, views, controllers, and routes. Additional topics discussed include gems, Git, and deploying to Heroku. The document concludes by outlining a sample project to build a marketplace for buying and selling robot spare parts.
- Ruby on Rails is an open-source, full-stack framework for developing database-backed web applications using the Model-View-Controller pattern. It uses the Ruby programming language.
- Rails uses conventions over configurations, don't repeat yourself (DRY) principles, and an opinionated philosophy. It provides a directory structure, environment modes, and generators to quickly develop applications.
- The document provides an example of generating a bookmarks application with models, views, controllers, validations, associations, and AJAX functionality using Rails.
This document provides an overview of learning to code for a startup minimum viable product (MVP) using Ruby on Rails. It discusses setting up a development environment, using Git version control, the Ruby programming language basics, Rails models and object-relational mapping, authentication with Devise, Rails controllers and routing, and using scaffolding to build out a sample Mini Twitter app with Posts and Users models. The goal is to provide attendees with the necessary skills to build a basic MVP for a startup.
Ruby on Rails is a full-stack web application framework built on Ruby that follows the model-view-controller architectural pattern. It features conventions over configuration, including a default directory structure, naming conventions, and configuration files. The framework emphasizes separation of concerns with the model handling data and business logic, the view handling presentation and user interaction, and the controller handling events and coordinating the model and view.
This document provides an overview of key concepts in Ruby on Rails including:
- Rails uses the MVC pattern with models, views, controllers, and follows conventions like RESTful design and resource-oriented URLs.
- ActiveRecord is the ORM that connects database tables to model classes for easy data access. Migrations help manage the database schema.
- Views use ERB templates to display data and helpers to DRY up common HTML patterns. Layouts wrap views in a consistent layout.
- Controllers handle HTTP requests and route them to actions that retrieve data from models and pass it to views to display. Flashes store temporary session data.
- Rake tasks help automate common
This document provides an overview of Ruby on Rails for rapid web application development. It discusses key Rails concepts like MVC, conventions over configuration, and scaffolding. It also demonstrates how to build a basic "Hello World" Rails app step-by-step, covering tasks like generating models and controllers, setting routes, and deploying. Additional sections explain ActiveRecord basics, associations, validations, and deploying Rails apps to Java application servers using JRuby on Rails.
This document discusses rapid web application development using Ruby on Rails. It covers topics such as what Ruby on Rails is, its principles of convention over configuration and DRY (Don't Repeat Yourself), the MVC framework, building a basic "Hello World" application step-by-step using generators, scaffolding to quickly generate CRUD applications, ActiveRecord basics for modeling and working with databases, migrations for database schema changes, validations, associations, controllers and actions, and deployment options like using the Goldspike plugin to deploy to Java application servers. Code demos and exercises are provided to illustrate key concepts.
The document summarizes Ricardo Sanchez's presentation on DevOps tools and Ruby/Rails. It discusses his background in operations and networking and introduces Ruby, Rails, RVM, Vagrant, Capistrano, Chef, and resources for learning Ruby. The presentation covers the basics of Ruby and Rails, how Rails applications work, and configuration/automation tools like RVM, Vagrant, Capistrano and Chef for managing servers and deployments.
Ricardo Sanchez - Ruby projects of interest for devopsSVDevOps
The document summarizes Ricardo Sanchez's presentation on DevOps tools and Ruby/Rails. It discusses his background in operations and networking and introduces Ruby, Rails, RVM, Vagrant, Capistrano, Chef, and resources for learning Ruby. The presentation covers the basics of Ruby and Rails, how Rails applications work, and configuration/automation tools like RVM, Vagrant, Capistrano and Chef for managing servers and deployments.
Ruby is an object-oriented programming language created in 1993, while Rails is a web application framework built using Ruby. The document provides an overview of Ruby and Rails, including what Rails is and its key advantages such as convention over configuration, don't repeat yourself (DRY) principles, and object-relational mapping (ORM). It also demonstrates creating a sample Rails application and using the Spree e-commerce gem.
The code will print false, because paid = true assigns a local variable rather than setting the instance variable @paid. To fix it, use self.paid = true.
The document provides an overview of Ruby on Rails including: why developers may be interested in Rails, key concepts like MVC architecture and conventions over configuration, how models, views and controllers work, database persistence with ActiveRecord, and common Rails tools like migrations, validations and associations. It also briefly discusses Ruby's creator Yukihiro Matsumoto, popular Rails applications, and resources for learning more.
Here are the changes to the people index view:
<h1>My Class List</h1>
<% @people.each do |person| %>
<p><%= person.first_name[0] %>. <%= person.last_name %></p>
<% end %>
Rails is a web application framework written in Ruby that uses the MVC architecture. It aims to reduce coding burden through its APIs and generators. Rails makes use of conventions like naming and placement of files to reduce configuration. The large Rails community provides support through documentation and libraries called gems that extend the framework's functionality. Key Rails concepts include routes, migrations, generators, object relationships and validations. Migrations allow managing the database schema through versions. Generators produce common code artifacts to speed development. Relationships define how objects connect to each other in the database. Validations ensure data integrity.
I prepared this presentation to introduce Ruby on Rails to
a group of students at Università di Catania.
It is not enough to get a good grasp of Rails, the
presentation in fact was supported by live coding, where
I started created a Phrasalbook (no more blog engine
please :) )
This document provides an introduction and overview of Ruby on Rails, including what it is, its key features and benefits, and how to get started building a basic web application with Rails. Some of the key points covered include Rails' emphasis on productivity through conventions over configuration, scaffolding, and its implementation of the MVC framework and full-stack capabilities. Examples are also given of generating a controller and view to output basic text and dynamic content.
Gen Z and the marketplaces - let's translate their needsLaura Szabó
The product workshop focused on exploring the requirements of Generation Z in relation to marketplace dynamics. We delved into their specific needs, examined the specifics in their shopping preferences, and analyzed their preferred methods for accessing information and making purchases within a marketplace. Through the study of real-life cases , we tried to gain valuable insights into enhancing the marketplace experience for Generation Z.
The workshop was held on the DMA Conference in Vienna June 2024.
Discover the benefits of outsourcing SEO to Indiadavidjhones387
"Discover the benefits of outsourcing SEO to India! From cost-effective services and expert professionals to round-the-clock work advantages, learn how your business can achieve digital success with Indian SEO solutions.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfFlorence Consulting
Quattordicesimo Meetup di Milano, tenutosi a Milano il 23 Maggio 2024 dalle ore 17:00 alle ore 18:30 in presenza e da remoto.
Abbiamo parlato di come Axpo Italia S.p.A. ha ridotto il technical debt migrando le proprie APIs da Mule 3.9 a Mule 4.4 passando anche da on-premises a CloudHub 1.0.
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
1. Ruby on Rails: An Introduction
JA-SIG Summer Conference 2007
Michael Irion
The University of Tulsa
2. What is Ruby on Rails (RoR)?
• Ruby on Rails is an open-source, full-stack
framework for developing database-backed web
applications according to the Model-View-Control
pattern
3. Overview of Ruby on Rails
• Ruby is the programming language used to
manipulate the framework
• Rails is the framework that provides the necessary
infrastructure
• Rails is written in Ruby
4. Ruby Features
• Ruby is an interpreted language (No compile step
necessary)
• Ruby is an Object Oriented language.
• Everything is an object (No primitives)
• Ruby draws from Perl, Smalltalk, and Lisp
5. Duck Typing in Ruby
• Objects are dynamic, and their types are determined
at runtime
• The type of a Ruby object is much less important
than it’s capabilities
• If a Ruby object walks like a duck and talks like a
duck, then it can be treated as a duck
9. Directory Layout
• Rails applications have a common directory structure
• /app - the MVC core
/controllers
/helpers - provides extra functionality for views
/models
/views/nameofcontroller - templates for controller
actions
10. Directory Layout
/components - will be deprecated
/config - database, route and environment configuration
/db - database schema and migrations
/lib - functions that don’t map to MVC
/log
/public - static web resources (html, css, javascript etc.)
/script - rails utilities
/test - tests and fixtures
/tmp
/vendor - 3rd party plugins
11. Rails Environment Modes
• Rails runs in different modes, depending on the
parameters given to the server on startup. Each
mode defaults to it’s own database schema
• Development (verbose logging and error messages)
• Test
• Production
12. Starting Rails
• > cd /directorypath/bookmarks
• Start the server
> ruby script/server start
• Default environment is development
• Default port is 3000
• http://127.0.0.1:3000
14. Mapping URLs to Controllers and Actions
• http://127.0.0.1:3000/hello/sayit
• http://127.0.0.1:3000 - address and port of the
webserver
• hello - name of the controller
• sayit - name of the action (method in controller)
16. Now for an actual Bookmark
• Edit config/database.yml
development:
adapter: mysql
database: bookmarks_development
username: username
password: password
host: localhost
17. Create the Database
• This step depends on the database and dba tool of
your choice. Create a new schema/dbname for
bookmarks_development, and assign rights for the
user you listed in database.yml.
18. Bookmark Model
• Our bookmark model will (initially) need two
properties
• URL
• Title
19. Scaffolding for Bookmarks
• Rails can generate all the basic CRUD operations
for simple models via scaffolding.
• Scaffolding is temporary way to get applications
wired quickly.
> ruby script/generate scaffold_resource bookmark
url:string title:string
20. Migrations
• Rails uses migrations to version the database.
• Rails tries to minimize SQL at every opportunity
• Migrations are automatically created whenever you
generate a new model
• Migration files are located in db/migrations
• The version number is stored in a table called
schema_info
21. Bookmarks Migration
located in db/migrate/001_create_bookmarks.rb
class CreateBookmarks < ActiveRecord::Migration
def self.up
create_table :bookmarks do |t|
t.column :url, :string
t.column :title, :string
end
end
def self.down
drop_table :bookmarks
end
end
22. Running the Migration
• Rake is the general purpose build tool for rails,
much like make, or ant. It has many functions, one
of which is to control migrations.
>rake db:migrate
• Now the table has been created
23. Bookmarks Table ID
• Bookmarks table has the following fields - id, url,
and title
• Where did the id field come from?
• Convention of configuration - Rails automatically
creates an id field for each new table and uses it as
the primary key
24. Bookmarks Controller
The /app/controllers/bookmarks.rb default action:
def index
@bookmarks = Bookmark.find(:all)
respond_to do |format|
format.html # index.rhtml
format.xml { render :xml => @bookmarks.to_xml }
end
End
25. Mapping URLs to Controllers and Actions
• http://127.0.0.1:3000/bookmarks/
• http://127.0.0.1:3000 - address and port of the
webserver
• hello - name of the controller
• / - name of the action (blank maps to the index
action)
26. Bookmarks Model - Don’t Repeat Yourself
• No getters/setters. Rails uses information from the
database.
class Bookmark < ActiveRecord::Base
end
27. Bookmarks View
Located in views/bookmarks/index.rhtml
<% for bookmark in @bookmarks %>
<tr>
<td><%=h bookmark.url %></td>
<td><%=h bookmark.title %></td>
<td><%=h bookmark.description %></td>
<td><%= link_to 'Show', bookmark_path(bookmark) %></td>
<td><%= link_to 'Edit', edit_bookmark_path(bookmark) %></td>
<td><%= link_to 'Destroy', bookmark_path(bookmark), :confirm => 'Are you
sure?', :method => :delete %></td>
</tr>
<% end %>
28. Convention over Configuration
• Bookmark model automatically looks for a table in
the database with a plural form of it’s name.
(bookmarks)
• The Bookmarks controller automatically renders the
template located in views according to the controller
name and the action (views/bookmarks/index.rhtml)
29. Ajax Helpers
• Rails allows you to program many AJAX calls in
ruby, instead of writing javascript directly
• Script.aculo.us and Prototype libraries are included
• A quick example. Autocomplete for text boxes
30. AJAX Autocomplete
Add to Bookmarks controller
auto_complete_for :bookmarks, :url
Add to views/bookmarks/edit.rhtml
<%= text_field_with_auto_complete :bookmark, :url %>
In views/layouts/bookmarks.rhtml, add
<%= javascript_include_tag :defaults %>
31. Validations
• Rails has a number of validation helpers that can be
added to the model.
class Bookmark < ActiveRecord::Base
validates_presence_of :url, :title
end
33. Associations - Adding Categories to Bookmarks
• The bookmarks are working great, but it would be
nice if we could group them by category
• Rails uses associations to build relationships
between tables
• Associations are independent of database foreign
key constraints
35. Changes to the Database
• A new categories table needs to be created
• A category_id field needs to be added to the bookmarks
table
> ruby script/generate scaffold_resource category name:string
• This creates the all the scaffolding and the migration
db/migrate/002_create_categories.rb
• Note the category table is pluralized as categories.
>ruby script/generate migration alter_bookmarks_add_category_id
• This creates
db/migrate/003_alter_bookmarks_add_category_id.rb
36. Alter Bookmarks Migration
def self.up
add_column :bookmarks, :category_id, :integer
end
def self.down
remove_column :bookmarks, :category_id
end
>rake db:migrate
38. Database Relationships
• Parent (or Master) models that have collections of
other models use the has_many relationship
• Child (or Detail) models contain the id field of their
parent record and they use the belongs_to
relationship
39. Associations Model Code
class Bookmark < ActiveRecord::Base
validates_presence_of :url, :title
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :bookmarks
end
42. Tools
• Textmate (Mac OS X)
• RadRails (Eclipse plugin) www.radrails.org
• Other commercial and opensource IDEs are being
made available
43. Resources
• Programming Ruby: The Pragmatic Programmers'
Guide - Second Edition
• Agile Web Development with Rails—Second
Edition
• Rails main site http://www.rubyonrails.com
• My email: michael-irion@utulsa.edu
Editor's Notes
Don&apos;t repeat yourself&quot; means that information is located in a single, unambiguous place. For example, using ActiveRecord, the developer does not need to specify column names in class definitions. Instead, Ruby can retrieve this information from the database.&quot;Convention over Configuration&quot; means a developer only needs to specify unconventional aspects of their application. For example, if there&apos;s a class Sale in the model, the corresponding table in the database is called sales by default. It is only if someone deviates from this convention, such as calling the table &quot;products_sold&quot;, that they need to write code regarding these names.makes it easer to do the right thing
Note that ‘ruby’ is only necessary on windows
Load up the app in firefox
Discuss where the files end up
Note the host and the
Go take a look at the result
Go over what this file means
Including blocks
Creates the database table
Go to controller to explain variables
Link_to help
Discuss the difference between commands and strings