Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
This presentation is done by Code71 Team to the IT community in Bangladesh. The presentation covers the basics of Ruby on Rails and the advantage of it over many other contemporary languages to build web applications. It also mentions the strength of RoR by siting great quotes and examples of great sites.
This document provides an overview and introduction to Ruby on Rails. It begins with an agenda and introduction to the speaker. It then provides a brief introduction to Rails, including what industries use it, examples of popular websites built with Rails, and an explanation of its model-view-controller architecture and RESTful design philosophy. The document continues with sections on auditing Rails applications, identifying common vulnerabilities like mass assignment and cross-site scripting, and recommendations for removing vulnerabilities.
Migrating PriceChirp to Rails 3.0: The Pain PointsSteven Evatt
The document summarizes the process of migrating the PriceChirp application from Rails 2.3 to Rails 3.0. It took 3 weeks to complete the migration. Key steps included upgrading gems, fixing code to remove deprecation warnings, installing Bundler, adding tests for critical functionality, using the Rails_upgrade plugin, and addressing changes to Active Record, views, and other areas of the framework. Challenges included upgrading plugins like Restful Authentication to Devise and converting from Prototype to jQuery for unobtrusive JavaScript support.
Ruby on Rails version 2.1 was released on June 1st, 2008. It included several new features such as timezones, dirty tracking, gem dependencies, named scopes, UTC-based migrations, and better caching. ActiveRecord changes included support for expressions in sum calculations, eager loading of associations, polymorphic URLs, and the ability to add and remove timestamps from tables.
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
This presentation is done by Code71 Team to the IT community in Bangladesh. The presentation covers the basics of Ruby on Rails and the advantage of it over many other contemporary languages to build web applications. It also mentions the strength of RoR by siting great quotes and examples of great sites.
This document provides an overview and introduction to Ruby on Rails. It begins with an agenda and introduction to the speaker. It then provides a brief introduction to Rails, including what industries use it, examples of popular websites built with Rails, and an explanation of its model-view-controller architecture and RESTful design philosophy. The document continues with sections on auditing Rails applications, identifying common vulnerabilities like mass assignment and cross-site scripting, and recommendations for removing vulnerabilities.
Migrating PriceChirp to Rails 3.0: The Pain PointsSteven Evatt
The document summarizes the process of migrating the PriceChirp application from Rails 2.3 to Rails 3.0. It took 3 weeks to complete the migration. Key steps included upgrading gems, fixing code to remove deprecation warnings, installing Bundler, adding tests for critical functionality, using the Rails_upgrade plugin, and addressing changes to Active Record, views, and other areas of the framework. Challenges included upgrading plugins like Restful Authentication to Devise and converting from Prototype to jQuery for unobtrusive JavaScript support.
Ruby on Rails version 2.1 was released on June 1st, 2008. It included several new features such as timezones, dirty tracking, gem dependencies, named scopes, UTC-based migrations, and better caching. ActiveRecord changes included support for expressions in sum calculations, eager loading of associations, polymorphic URLs, and the ability to add and remove timestamps from tables.
Introduction to Rails - presented by Arman Ortegaarman o
This document provides an introduction to Ruby on Rails presented by Arman Ortega. It outlines what will be covered including an overview of Ruby and Rails, the concept of convention over configuration in Rails, and performing CRUD (create, read, update, delete) operations. It then demonstrates creating a sample blog application in Rails and provides links for additional learning resources.
This document provides an introduction and overview of Ruby and Ruby on Rails (RoR). It discusses that Ruby is an object-oriented programming language created in 1993, and RoR is a web application framework built on Ruby. It outlines the structure of a basic RoR application, including models, views, controllers, and databases. It also provides examples of generating scaffolds and basic RoR commands.
The document introduces Ruby on Rails and provides an overview of its features and benefits. It summarizes the speaker's experience with web development over time, introduces MVC and ORM concepts, and demonstrates Rails through a live coding example. Key advantages of Rails highlighted include its convention over configuration approach, use of Ruby as a dynamic scripting language, and ability to rapidly develop database-backed web applications.
Ruby on Rails is a web application framework written in Ruby. It was created in 2004 by David Heinemeier Hansson and has since become one of the most popular frameworks for web development. Rails emphasizes convention over configuration, following agile programming principles, and aims to make web development simpler and more enjoyable. The core components of a Rails application include models, views, controllers, helpers and initializers organized into folders that follow standard conventions.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
The document discusses Ruby on Rails, an open-source web application framework. It is optimized for programmer happiness and productivity by favoring convention over configuration, allowing developers to write code more quickly. Ruby on Rails uses a model-view-controller (MVC) architecture and is widely adopted by companies like Twitter.
Ruby on Rails is a web application framework that follows the model-view-controller (MVC) pattern and includes everything needed to build database-backed web applications using the Ruby programming language. It aims to make web development more productive by utilizing conventions that reduce the need for configuration and promote reuse of common tasks like connecting to databases. The framework provides models for interacting with the database, views for displaying the user interface, and controllers that handle and respond to user input by manipulating models and rendering views.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
Rami Sayar presented on advanced Django architecture techniques for scaling Django applications in production environments. He discussed load balancing Django across multiple servers using solutions like HAProxy. He also covered caching with Varnish to improve performance, and using Redis or Memcached for caching. Finally, he discussed asynchronous task queues like Celery for processing tasks outside the request-response cycle.
This document discusses using DataMapper with Infinispan as a clustered NoSQL data store. It covers:
- DataMapper is a Ruby ORM that can use Infinispan as its data adapter through the dm-infinispan-adapter gem.
- Infinispan is a highly scalable, distributed Java cache that provides a data grid. It supports replication, distribution and local caching.
- The dm-infinispan-adapter allows DataMapper objects to be stored in Infinispan, enabling a clustered NoSQL backend for Ruby applications. It generates runtime annotations to integrate with Hibernate Search.
Ruby on Rails is a web application framework that is designed to make programming web applications easier and more enjoyable. It includes features like an object-relational mapper called Active Record that allows database rows to be represented as objects, conventions that reduce configuration, and support for test-driven development. Rails is built on Ruby, an interpreted object-oriented programming language, and aims to be programmer friendly and allow powerful applications to be built quickly. Several experts praise Rails for lowering the barriers to entry for programming and being a well-thought-out framework.
Picking gem ruby for penetration testersPaolo Perego
The document discusses various techniques for penetration testing and attacking web applications using Ruby tools and libraries. It provides examples of using tools like Anemone for crawling sites, Casper for observing browser requests, Enchant for directory brute forcing, and Ciphersurfer for evaluating SSL configurations. The document encourages attackers to change their mindset and look for vulnerabilities from the perspective of an attacker rather than a developer.
This document provides an overview of Java fundamentals including:
- A brief history of Java's development from 1991-1995.
- An explanation of how Java code is compiled to bytecode and run on any machine by a Java Virtual Machine (JVM), making Java platform independent.
- Descriptions of Java applications and applets, the Java Development Kit (JDK), Java Runtime Environment (JRE), and object-oriented programming principles in Java like inheritance and polymorphism.
- Details of Java's features like being compiled and interpreted, platform independent, object-oriented, robust, secure, distributed, and multi-threaded.
- An example of the "Hello World" first Java program.
This document introduces Ruby as a programming language and testing tool. It provides an overview of Ruby basics like arrays, hashes, blocks, and classes. It also discusses how to install Ruby, the Ruby culture which emphasizes readability and flexibility, and testing tools like Cucumber and Capybara that enable behavior-driven development in Ruby. Examples are given of how to write Cucumber features and steps to test a pets application.
The document summarizes the key points about RubyGems 3 & 4 from Hiroshi SHIBATA's presentation at RubyKaigi 2018. It discusses RubyGems 2.7, including support for older Ruby versions. It then covers plans for RubyGems 3.0, such as removing deprecated code, and RubyGems 4.0, which may include non-backwards compatible changes.
O documento discute o framework Rhodes para desenvolvimento de aplicações móveis multiplataforma usando Ruby. Rhodes permite escrever uma vez e rodar em diversos sistemas, incluindo Android, iPhone e BlackBerry. Oferece recursos como acesso a câmera, GPS e agenda de contatos, além de ferramentas como banco de dados local e teste automatizado.
Introduction to Rails - presented by Arman Ortegaarman o
This document provides an introduction to Ruby on Rails presented by Arman Ortega. It outlines what will be covered including an overview of Ruby and Rails, the concept of convention over configuration in Rails, and performing CRUD (create, read, update, delete) operations. It then demonstrates creating a sample blog application in Rails and provides links for additional learning resources.
This document provides an introduction and overview of Ruby and Ruby on Rails (RoR). It discusses that Ruby is an object-oriented programming language created in 1993, and RoR is a web application framework built on Ruby. It outlines the structure of a basic RoR application, including models, views, controllers, and databases. It also provides examples of generating scaffolds and basic RoR commands.
The document introduces Ruby on Rails and provides an overview of its features and benefits. It summarizes the speaker's experience with web development over time, introduces MVC and ORM concepts, and demonstrates Rails through a live coding example. Key advantages of Rails highlighted include its convention over configuration approach, use of Ruby as a dynamic scripting language, and ability to rapidly develop database-backed web applications.
Ruby on Rails is a web application framework written in Ruby. It was created in 2004 by David Heinemeier Hansson and has since become one of the most popular frameworks for web development. Rails emphasizes convention over configuration, following agile programming principles, and aims to make web development simpler and more enjoyable. The core components of a Rails application include models, views, controllers, helpers and initializers organized into folders that follow standard conventions.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
The document discusses Ruby on Rails, an open-source web application framework. It is optimized for programmer happiness and productivity by favoring convention over configuration, allowing developers to write code more quickly. Ruby on Rails uses a model-view-controller (MVC) architecture and is widely adopted by companies like Twitter.
Ruby on Rails is a web application framework that follows the model-view-controller (MVC) pattern and includes everything needed to build database-backed web applications using the Ruby programming language. It aims to make web development more productive by utilizing conventions that reduce the need for configuration and promote reuse of common tasks like connecting to databases. The framework provides models for interacting with the database, views for displaying the user interface, and controllers that handle and respond to user input by manipulating models and rendering views.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
Rami Sayar presented on advanced Django architecture techniques for scaling Django applications in production environments. He discussed load balancing Django across multiple servers using solutions like HAProxy. He also covered caching with Varnish to improve performance, and using Redis or Memcached for caching. Finally, he discussed asynchronous task queues like Celery for processing tasks outside the request-response cycle.
This document discusses using DataMapper with Infinispan as a clustered NoSQL data store. It covers:
- DataMapper is a Ruby ORM that can use Infinispan as its data adapter through the dm-infinispan-adapter gem.
- Infinispan is a highly scalable, distributed Java cache that provides a data grid. It supports replication, distribution and local caching.
- The dm-infinispan-adapter allows DataMapper objects to be stored in Infinispan, enabling a clustered NoSQL backend for Ruby applications. It generates runtime annotations to integrate with Hibernate Search.
Ruby on Rails is a web application framework that is designed to make programming web applications easier and more enjoyable. It includes features like an object-relational mapper called Active Record that allows database rows to be represented as objects, conventions that reduce configuration, and support for test-driven development. Rails is built on Ruby, an interpreted object-oriented programming language, and aims to be programmer friendly and allow powerful applications to be built quickly. Several experts praise Rails for lowering the barriers to entry for programming and being a well-thought-out framework.
Picking gem ruby for penetration testersPaolo Perego
The document discusses various techniques for penetration testing and attacking web applications using Ruby tools and libraries. It provides examples of using tools like Anemone for crawling sites, Casper for observing browser requests, Enchant for directory brute forcing, and Ciphersurfer for evaluating SSL configurations. The document encourages attackers to change their mindset and look for vulnerabilities from the perspective of an attacker rather than a developer.
This document provides an overview of Java fundamentals including:
- A brief history of Java's development from 1991-1995.
- An explanation of how Java code is compiled to bytecode and run on any machine by a Java Virtual Machine (JVM), making Java platform independent.
- Descriptions of Java applications and applets, the Java Development Kit (JDK), Java Runtime Environment (JRE), and object-oriented programming principles in Java like inheritance and polymorphism.
- Details of Java's features like being compiled and interpreted, platform independent, object-oriented, robust, secure, distributed, and multi-threaded.
- An example of the "Hello World" first Java program.
This document introduces Ruby as a programming language and testing tool. It provides an overview of Ruby basics like arrays, hashes, blocks, and classes. It also discusses how to install Ruby, the Ruby culture which emphasizes readability and flexibility, and testing tools like Cucumber and Capybara that enable behavior-driven development in Ruby. Examples are given of how to write Cucumber features and steps to test a pets application.
The document summarizes the key points about RubyGems 3 & 4 from Hiroshi SHIBATA's presentation at RubyKaigi 2018. It discusses RubyGems 2.7, including support for older Ruby versions. It then covers plans for RubyGems 3.0, such as removing deprecated code, and RubyGems 4.0, which may include non-backwards compatible changes.
O documento discute o framework Rhodes para desenvolvimento de aplicações móveis multiplataforma usando Ruby. Rhodes permite escrever uma vez e rodar em diversos sistemas, incluindo Android, iPhone e BlackBerry. Oferece recursos como acesso a câmera, GPS e agenda de contatos, além de ferramentas como banco de dados local e teste automatizado.
Ruby + Rails no Mundo Real 2010 - Voodoo é pra Jacu - Entendendo metaprograma...David Paniz
Palestra apresentada durante o evento Ruby + Rails no Mundo Real 2010.
Entendendo, de verdade, como funciona metaprogramação em ruby e desmistificando o que normalmente chamam de magia negra.
Este documento apresenta uma introdução ao grupo Guru::SP, que promove encontros mensais sobre Ruby e Rails, incluindo palestras e um tutorial de Ruby. O grupo também traduz a revista Rails Magazine e planeja eventos anuais para a comunidade.
O documento discute Behavior Driven Development (BDD) e como usar Cucumber para implementar testes de aceitação. Ele fornece detalhes sobre como estruturar cenários de teste usando Gherkin e definir etapas de teste com Ruby. Além disso, discute como usar recursos como contextos, esquemas de cenários e tags para organizar e executar os testes.
This document discusses techniques for refactoring Ruby code to follow object-oriented principles and design patterns. It provides examples of refactoring a Bhaskara equation solver class to have better encapsulation, organization and separation of concerns. It also discusses ways to make objects more collection-like and use delegation, modules and other techniques to improve code design. The overall goal is to help Ruby developers write more maintainable, understandable and "enterprise-ready" code.
This document provides instructions for migrating legacy Rails apps to Rails 3. It discusses updating the Rails version and dependencies using Bundler, upgrading plugins to gems, refactoring controllers to be RESTful, and addressing deprecation warnings. The rails_upgrade plugin helps analyze apps and generate a Gemfile to ease the upgrade process. Key steps include running checks and generating backups before upgrading code to Rails 3 features.
Crafting Beautiful CLI Applications in RubyNikhil Mungel
The document describes a presentation on crafting beautiful command line applications using Ruby. The presentation discusses why the command line is useful, what makes a good CLI app, and some key principles for CLI apps like least astonishment, reversibility, config files, graceful failure, and honoring piping. It also covers input/output in CLI apps and libraries like OptionParser, Mixlib::CLI, and Thor that can help build CLI apps in Ruby.
Play Framework and Ruby on Rails are web application frameworks that help developers build web applications. Both frameworks provide tools and libraries for common tasks like routing, database access, templates and more. Some key similarities include using MVC patterns, supporting SQL/NoSQL databases via libraries, and including tools for unit testing and deployment. Some differences are Play uses Scala and Java while Rails uses Ruby, and they have different project structures and ways of handling assets, templates and dependencies. Both aim to help developers build web applications faster with their features and ecosystem of supporting libraries.
Rack provides a simple interface for building web applications in Ruby. This document outlines how to build a basic web framework on top of Rack by leveraging existing Rack middleware and tools. It demonstrates how to add features like routing, controllers, views, ORM, authentication, testing, and a console using middleware like Usher, Tilt, DataMapper, Warden, rack-test, and racksh. The goal is to create a simple but full-featured framework with minimal code by combining existing Rack components.
The document discusses using JRuby to integrate Ruby and Rails into an existing Java/Spring application. It describes using JRuby, Warbler, Rack, and Rails to refactor the application in stages from small changes like adding tests and routing, to medium changes like layering on Rails, to a large refactor of the directory structure and bootstrapping Rails within the Spring context.
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
Rack provides a standard interface between web servers and web applications. It allows a web application to return a status, headers, and a body in response to an HTTP request. Middleware can be plugged into a Rack application to modify requests and responses. Popular Rack middleware includes Rack::Cache, Rack::Middleware, and Warden for authentication. In Rails, middleware is configured through an initializer and plugged into the middleware stack to run before or after other middleware.
The document discusses plugins, generators, and gems in Ruby on Rails. Plugins are used to extend Rails functionality and are installed into a Rails application. Generators are Rails commands that generate code or files within an application. Gems are packages for distributing and sharing libraries, and the document provides instructions for creating a gem using Bundler that includes a generator.
The document summarizes changes in Rails 3 including:
1. Bundler is introduced for managing gem dependencies through a Gemfile.
2. The ActiveRecord query interface is updated with method chaining and relations to unify finders, named scopes, and with_scope.
3. The ActiveRecord validation API is updated to use hashes instead of separate validator methods for validation options.
4. Views are updated with automatic XSS escaping, unobtrusive JavaScript, and consistent <%= %> usage for output.
5. Internationalization is updated with %{} instead of {{ }} for translations.
Rails 3 provides a concise overview of changes in Rails 3 including maintaining MVC structure and RESTful routing while improving areas like file structure, block helpers, routing and constraints, ActiveRecord querying, resources routing, and ActionMailer delivery. Key changes include a more Rack-like implementation, chainable ActiveRecord scopes, and pagination and layout support in ActionMailer.
Ecossistema Ruby - versão SCTI UNF 2013Fabio Akita
This document discusses various topics related to Ruby on Rails development including:
- The Ruby on Rails ecosystem and frameworks like Ruby, Rails, and JRuby.
- Version control using Git for source code management.
- Development tools and environments including Vagrant, Vim, and dotfiles.
- Continuous integration, exception tracking, code quality, and search using tools like Airbrake, Brakeman, and Sunspot.
- Asynchronous messaging with Pusher.
- Deployment using web servers like Nginx, Passenger and web platforms like Heroku, AppFog, and Helios.
Rails 4.0 introduced the following changes:
1. Thread safety is enabled by default.
2. Strong Parameters were added for mass assignment protection.
3. Turbolinks was added to speed up page loads by preventing full page reloads.
4. Russian Doll Caching was introduced to maximize cache hits by nesting fragment caches.
Some features were extracted to gems including Action and Page Caching, Active Resource, and AR Observer. The deprecation policy removes deprecated features in future versions. Strong Parameters replace attr_accessible. Turbolinks improves performance. Russian Doll Caching optimizes caching.
The document discusses how to deploy Rails applications using Capistrano. It covers setting up the Rails environment with Ruby, RubyGems, Rails, Mongrel, Subversion, and Capistrano. It then discusses configuring Capistrano, Apache virtual hosts, and Mongrel clusters. It provides details on the deploy.rb file configuration including database, mongrel cluster, and roles.
This document discusses deployment strategies for Ruby on Rails applications. It covers common components of the "Rails stack" including databases, caching, application servers and load balancers. Popular options are mentioned like Nginx, Memcached, Mongrel and Capistrano. Performance optimization techniques are also summarized, such as caching, background processing and memory usage strategies. The document concludes with an overview of common deployment processes and challenges.
This document discusses how Rails may not be the best tool for rapid prototyping and suggests alternatives that are more lightweight and collaborative. It introduces Serve, an alternative to Rails that uses a simple folder structure and views to quickly prototype ideas without models, controllers or routing. Serve works with popular front-end tools and libraries and can deploy to Heroku. The document argues that prototyping tools should empower all team members, including front-end developers, and that Rack middleware like Rack::Cascade allows reusing mockups and wireframes in a Rails app.
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
Performance de sites não tem a ver com a linguagem usada por baixo. O impacto maior é a arquitetura. Nesta palestra falo sobre YSlow, Resque e Solr como algumas das coisas que podemos fazer para melhorar a performance/escalabilidade de aplicações web.
Dans cette session vous apprendrez tout sur Ruby. Le langage, les frameworks, la communauté, mais surtout un esprit. Passé le teaser, Nicolas Ledez vous présentera comment Ruby peut vous apporter tous les jours une méthodologie dans votre travail, et des outils pour réaliser un prototype rapidement. Quel que soit votre langage d'origine, Ruby complète parfaitement votre boite à outils de développeur/administrateur système.
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
Groovy is a dynamic language for the Java Virtual Machine that integrates with Java. Grails is a web framework built on Groovy that leverages existing Java technologies. The presentation discusses how Groovy's meta-programming capabilities, through its Meta Object Protocol, enable new patterns like dynamic finders that change how we approach common Java patterns like the Data Access Object and Service Locator.
The document discusses using generators to automate common tasks in Rails applications. It recommends modularizing and gemifying reusable code to create generators. The benefits of generators include consistency across projects, reduced copying/pasting of code, and time savings. The document provides examples of generating gems, updating applications to Rails 3, and customizing generator templates. It also discusses best practices like keeping Gemfile.lock up to date and using files instead of git branches.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
2. Rails 3
ID blog twitter
Hugo Baraúna blog.plataformatec.com @hugobarauna
3. Quem sou eu?
• Hugo Baraúna
• 24 anos
• Engenharia de Computação na Politécnica da USP
• Desenvolvedor Ruby e Rails há mais de 3 anos
• Co-fundador e engenheiro da Plataforma Tecnologia
Hugo Baraúna blog.plataformatec.com @hugobarauna
7. Arquitetura
Todo o resto são
Rails 3 Railties!
Rails
ActionDispatch
ActiveSupport
Hugo Baraúna blog.plataformatec.com @hugobarauna
8. Arquitetura
Todo o resto são
Rails 3 Railties!
ActiveRecord
Rails
ActionView
ActionDispatch
outros...
ActiveSupport
ActionController
ActionMailer
Hugo Baraúna blog.plataformatec.com @hugobarauna
15. blog/config.ru
require ::File.expand_path('../config/environment', __FILE__)
run Blog::Application
Hugo Baraúna blog.plataformatec.com @hugobarauna
16. blog/config.ru
require ::File.expand_path('../config/environment', __FILE__)
run Blog::Application
Hugo Baraúna blog.plataformatec.com @hugobarauna
17. blog/config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Blog
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
18. blog/config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Blog uma Rack App!
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
19. blog/config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Blog
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
20. blog/config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Blog
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
21. blog/config/boot.rb
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Hugo Baraúna blog.plataformatec.com @hugobarauna
22. blog/config/boot.rb
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Hugo Baraúna blog.plataformatec.com @hugobarauna
55. Named routes
Rails 2.3
map.purchase "products/:id/purchase", :controller => "catalog",
:action => "purchase"
Rails 3
match "products/:id/purchase" => 'catalog#purchase',
:as => :purchase
Hugo Baraúna blog.plataformatec.com @hugobarauna
56. Resources com member e
collection
Rails 2.3
map.resources :products, :member => { :short => :get,
:toggle => :post }, :collection => { :sold => :get }
resources :products do
Rails 3 member do
get :short
post :toggle
end
collection do
get :sold
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
57. Router and Rack FTW!
Hugo Baraúna blog.plataformatec.com @hugobarauna
59. Rack FTW!
match "posts/:echo" => "posts#show"
Hugo Baraúna blog.plataformatec.com @hugobarauna
60. Rack FTW!
match "posts/:echo" => "posts#show"
uma Rack App!
match "posts/:echo" => PostsController.action(:show)
Hugo Baraúna blog.plataformatec.com @hugobarauna
61. Rack FTW!
match "posts/:echo" => "posts#show"
match "posts/:echo" => PostsController.action(:show)
uma Rack App!
match "posts/:echo" => lambda { |env| [ 200, {“Content-Type” =>
“plain/text”}, ["Echo!"] ] }
Hugo Baraúna blog.plataformatec.com @hugobarauna
62. Rack FTW!
match "posts/:echo" => "posts#show"
match "posts/:echo" => PostsController.action(:show)
match "posts/:echo" => lambda { |env| [ 200, {“Content-Type” =>
“plain/text”}, ["Echo!"] ] }
uma Rack App!
match "posts/:echo" => MySinatraBlog
Hugo Baraúna blog.plataformatec.com @hugobarauna
65. ActionMailer new API
guru/code$ rails g mailer Notifier signup_notification
create app/mailers/notifier.rb
invoke erb
create app/views/notifier
create app/views/notifier/signup_notification.text.erb
invoke test_unit
create test/functional/notifier_test.rb
guru/code$ ls -lp app/
controllers/
helpers/
mailers/
models/
views/
Hugo Baraúna blog.plataformatec.com @hugobarauna
66. ActionMailer new API
guru/code$ rails g mailer Notifier signup_notification
create app/mailers/notifier.rb
invoke erb
create app/views/notifier
create app/views/notifier/signup_notification.text.erb
invoke test_unit
create test/functional/notifier_test.rb
guru/code$ ls -lp app/
controllers/
helpers/
mailers com diretório próprio
mailers/
models/
views/
Hugo Baraúna blog.plataformatec.com @hugobarauna
67. ActionMailer new API
class Notifier < ActionMailer::Base
default :from => "system@example.com"
def signup_notification(recipient)
@account = recipient
attachments['image.jpg'] = File.read
("image.jpg")
mail(:to => recipient.email) do |format|
format.html
format.text
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
68. ActionMailer new API
class Notifier < ActionMailer::Base
Variáveis default :from => "system@example.com"
de
instância def signup_notification(recipient)
@account = recipient
attachments['image.jpg'] = File.read
("image.jpg")
mail(:to => recipient.email) do |format|
format.html
format.text
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
69. ActionMailer new API
class Notifier < ActionMailer::Base
Variáveis default :from => "system@example.com"
de
instância def signup_notification(recipient)
@account = recipient Attachments tipo
attachments['image.jpg'] = File.read cookies
("image.jpg")
mail(:to => recipient.email) do |format|
format.html
format.text
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
70. ActionMailer new API
class Notifier < ActionMailer::Base
Variáveis default :from => "system@example.com"
de
instância def signup_notification(recipient)
@account = recipient Attachments tipo
attachments['image.jpg'] = File.read cookies
("image.jpg")
mail(:to => recipient.email) do |format|
format.html
format.text
end
end mail tipo respond_to do |format|
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
71. AbstractController::Base
ActionController::Metal
ActionMailer::Base ActionController::Base
Hugo Baraúna blog.plataformatec.com @hugobarauna
75. ActiveModel
• Google Summer of Code 2009:
Hugo Baraúna blog.plataformatec.com @hugobarauna
76. ActiveModel
• Google Summer of Code 2009:
• Extraira lógica comum entre ActiveRecord e
ActiveResource
Hugo Baraúna blog.plataformatec.com @hugobarauna
77. ActiveModel
• Google Summer of Code 2009:
• Extraira lógica comum entre ActiveRecord e
ActiveResource
• Hoje
Hugo Baraúna blog.plataformatec.com @hugobarauna
78. ActiveModel
• Google Summer of Code 2009:
• Extraira lógica comum entre ActiveRecord e
ActiveResource
• Hoje
• Desempenha papel no agnosticismo de ORM
Hugo Baraúna blog.plataformatec.com @hugobarauna
79. ActiveModel
• Google Summer of Code 2009:
• Extraira lógica comum entre ActiveRecord e
ActiveResource
• Hoje
• Desempenha papel no agnosticismo de ORM
• Permite a criação de models à la ActiveRecord
Hugo Baraúna blog.plataformatec.com @hugobarauna
80. ActiveResource::Base +
ActiveModel
module ActiveResource
...
class Base
extend ActiveModel::Naming
include CustomMethods, Observing, Validations
include ActiveModel::Conversion
include ActiveModel::Serializers::JSON
include ActiveModel::Serializers::Xml
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
81. ActiveRecord::Base +
ActiveModel
Base.class_eval do
...
extend ActiveModel::Naming
...
include ActiveModel::Conversion
include Validations
...
include Callbacks, ActiveModel::Observing, Timestamp
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
83. Agnosticismo de ORM
Agnosticismo de ORM
ActiveModel Rails::Railtie
Hugo Baraúna blog.plataformatec.com @hugobarauna
84. Agnosticismo de ORM
Agnosticismo de ORM
ActiveModel Rails::Railtie
Provê uma API para que o
ActionPack possa conversar com o
ORM
Hugo Baraúna blog.plataformatec.com @hugobarauna
85. Agnosticismo de ORM
Agnosticismo de ORM
ActiveModel Rails::Railtie
Provê uma API para que o
Integração do ORM com o Rails
ActionPack possa conversar com o
ORM
Hugo Baraúna blog.plataformatec.com @hugobarauna
87. module ActiveModel
module Lint
module Tests
def test_to_key
assert model.respond_to?(:to_key), "The model should respond to to_key"
def model.persisted?() false end
assert model.to_key.nil?
end
def test_to_param
assert model.respond_to?(:to_param), "The model should respond to to_param"
def model.persisted?() false end
assert model.to_param.nil?
end
def test_valid?
assert model.respond_to?(:valid?), "The model should respond to valid?"
assert_boolean model.valid?, "valid?"
end
...
def test_persisted?
assert model.respond_to?(:persisted?), "The model should respond to persisted?"
assert_boolean model.persisted?, "persisted?"
end
def test_errors_aref
assert model.respond_to?(:errors), "The model should respond to errors"
assert model.errors[:hello].is_a?(Array), "errors#[] should return an Array"
end
def test_errors_full_messages
assert model.respond_to?(:errors), "The model should respond to errors"
assert model.errors.full_messages.is_a?(Array), "errors#full_messages should return an Array"
end
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
88. def test_to_param
assert model.respond_to?(:to_param), "The model should
respond to to_param"
def model.persisted?() false end
assert model.to_param.nil?
end
def test_valid?
assert model.respond_to?(:valid?), "The model should
respond to valid?"
assert_boolean model.valid?, "valid?"
end
...
def test_errors_aref
assert model.respond_to?(:errors), "The model should
respond to errors"
assert model.errors[:hello].is_a?(Array), "errors#[]
should return an Array"
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
89. ActiveRecord-like
Ótimo exemplo de uso do ActiveModel
http://github.com/plataformatec/mail_form
Hugo Baraúna blog.plataformatec.com @hugobarauna
93. RAILS 2.3
def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
94. RAILS 2.3
def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
95. RAILS 3.0
respond_to :html, :xml
def index
@users = User.all
respond_with(@users)
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
96. RAILS 3.0
respond_to :html, :xml
def index
@users = User.all
respond_with(@users)
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
97. Navigational API
GET
POST
PUT
DELETE
Hugo Baraúna blog.plataformatec.com @hugobarauna
98. Navigational API
GET
POST
PUT
DELETE
Hugo Baraúna blog.plataformatec.com @hugobarauna
99. Navigational API
GET
POST
PUT
DELETE
Hugo Baraúna blog.plataformatec.com @hugobarauna
100. respond_to :html, :xml
def index
@users = User.all
respond_with(@users)
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
101. Navigational API
render
GET render template
collection.to_format
POST
PUT
DELETE
Hugo Baraúna blog.plataformatec.com @hugobarauna
102. RAILS 2.3
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
format.html { redirect_to @user, :notice => 'User was
successfully created' }
format.xml { render :xml => @user, :status
=> :created, :location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status
=> :unprocessable_entity }
end
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
103. RAILS 3.0
def create
@user = User.new(params[:user])
flash[:notice] = 'User was successfully created' if @user.save
respond_with(@user)
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
104. Navigational API
render
GET render template
collection.to_format
render
Success redirect_to resource
resource.to_format
POST
Failure render :new render resource.errors
PUT
DELETE
Hugo Baraúna blog.plataformatec.com @hugobarauna
105. Navigational API
render
GET render template
collection.to_format
render
Success redirect_to resource
resource.to_format
POST
Failure render :new render resource.errors
Success redirect_to resource head :ok
PUT
Failure render :edit render resource.errors
DELETE redirect_to collection head :ok
Hugo Baraúna blog.plataformatec.com @hugobarauna
106. respond_with(@users)
ActionController::Responder
Hugo Baraúna blog.plataformatec.com @hugobarauna
107. respond_with(@users)
ActionController::Responder
table.to_code
Navigational API
GET render template render
collection.to_format
Success redirect_to resource render
resource.to_format
POST
Failure render :new render resource.errors
Success redirect_to resource head :ok
PUT
Failure render :edit render resource.errors
DELETE redirect_to collection head :ok
Hugo Baraúna blog.plataformatec.com @hugobarauna
112. github.com/plataformatec/responders
FlashResponder: seta o flash baseado na action do
controller e no status do recurso
HttpCacheResponder: automaticamente adiciona o
cabeçalho HTTP Last-Modified para requests de API
format
Hugo Baraúna blog.plataformatec.com @hugobarauna
113. CONFIGURANDO O RESPONDERS
# lib/application_responder.rb
class ApplicationResponder < ActionController::Responder
include Responders::FlashResponder
include Responders::HttpCacheResponder
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
114. CONFIGURANDO O RESPONDERS
# lib/application_responder.rb
class ApplicationResponder < ActionController::Responder
include Responders::FlashResponder
include Responders::HttpCacheResponder
end
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
self.responder = ApplicationResponder
respond_to :html
protect_from_forgery
layout 'application'
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
115. SEM O RESPONDERS
# app/controllers/users_controller.rb
def create
@user = User.new(params[:user])
flash[:notice] = 'User was successfully created' if @user.save
respond_with(@user)
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
116. SEM O RESPONDERS
# app/controllers/users_controller.rb
def create
@user = User.new(params[:user])
flash[:notice] = 'User was successfully created' if @user.save
respond_with(@user)
end
O FlashResponder vai
fazer isso por mim
Hugo Baraúna blog.plataformatec.com @hugobarauna
117. COM O RESPONDERS
# app/controllers/users_controller.rb
def create
@user = User.new(params[:user])
@user.save
respond_with(@user)
end
# config/locales/en.yml
en:
flash:
users:
create:
success: “User was successfully created”
Hugo Baraúna blog.plataformatec.com @hugobarauna
121. Lazy loading
# Rails 2.3
Job.find(:all, :conditions => {:published => true})
Faz um query no DB imediatamente e retorna um array de Jobs
# Rails 3
Job.where(:published => true)
Não faz query no DB, retorna um ActiveRecord::Relation
Hugo Baraúna blog.plataformatec.com @hugobarauna
122. Onde a query roda?
# app/controllers/jobs_controller.rb
class JobsController < ApplicationController
def index
@jobs = Jobs.where(:published => true).order("created_at DESC")
end
end
# app/views/jobs/index.html.erb
<% cache do %>
<% @jobs.each do |job| %>
...
<% end %>
<% end %>
Hugo Baraúna blog.plataformatec.com @hugobarauna
123. Onde a query roda?
# app/controllers/jobs_controller.rb
class JobsController < ApplicationController
def index
@jobs = Jobs.where(:published => true).order("created_at DESC")
end
end
Não realiza query no DB
# app/views/jobs/index.html.erb
<% cache do %>
<% @jobs.each do |job| %>
...
<% end %>
<% end %>
Hugo Baraúna blog.plataformatec.com @hugobarauna
124. Onde a query roda?
# app/controllers/jobs_controller.rb
class JobsController < ApplicationController
def index
@jobs = Jobs.where(:published => true).order("created_at DESC")
end
end
Não realiza query no DB
# app/views/jobs/index.html.erb
<% cache do %>
<% @jobs.each do |job| %>
...
<% end %>
<% end %>
Só aqui que será feito a query no DB
Hugo Baraúna blog.plataformatec.com @hugobarauna
125. Onde a query roda?
# app/controllers/jobs_controller.rb
class JobsController < ApplicationController
def index
@jobs = Jobs.where(:published => true).order("created_at DESC")
end
end
Não realiza query no DB
# app/views/jobs/index.html.erb
Se estiver cacheado, não faz
<% cache do %>
a query no controller a toa
<% @jobs.each do |job| %>
...
<% end %>
<% end %>
Só aqui que será feito a query no DB
Hugo Baraúna blog.plataformatec.com @hugobarauna
126. Chainability:
it “quacks” like named_scope
Job.where(:title => 'Rails Developer')
Job.order('created_at DESC').limit(20).includes(:company)
cars = Car.where(:colour => 'black')
black_fancy_cars = cars.order('cars.price DESC').limit(10)
black_cheap_cart = cars.order('cars.price ASC').limit(10)
Hugo Baraúna blog.plataformatec.com @hugobarauna
127. Chainability:
it “quacks” like named_scope
Job.where(:title => 'Rails Developer')
Job.order('created_at DESC').limit(20).includes(:company)
ActiveRecord::Relation
cars = Car.where(:colour => 'black')
black_fancy_cars = cars.order('cars.price DESC').limit(10)
black_cheap_cart = cars.order('cars.price ASC').limit(10)
Hugo Baraúna blog.plataformatec.com @hugobarauna
128. Chainability:
it “quacks” like named_scope
Job.where(:title => 'Rails Developer')
Job.order('created_at DESC').limit(20).includes(:company)
ActiveRecord::Relation
cars = Car.where(:colour => 'black')
black_fancy_cars = cars.order('cars.price DESC').limit(10)
black_cheap_cart = cars.order('cars.price ASC').limit(10)
Reaproveitar uma Relation
e encadear mais finders
Hugo Baraúna blog.plataformatec.com @hugobarauna
143. JS para todos os gostos
• Prototype: default
• jQuery: http://github.com/rails/jquery-ujs
• MooTools: http://mootools.net/forge/p/rails_3_driver
• Você pode fazer o seu!
Hugo Baraúna blog.plataformatec.com @hugobarauna
145. Javascript no Rails 3
Agnosticismo de Javascript
HTML 5 custom data attributes JS driver para cada framework
Hugo Baraúna blog.plataformatec.com @hugobarauna
152. Helpers que retornam HTML
module ApplicationHelper
def strong(content)
"<strong>#{h content}</string>".html_safe
end
end
Hugo Baraúna blog.plataformatec.com @hugobarauna
153. Helpers que retornam HTML
module ApplicationHelper
def strong(content)
"<strong>#{h content}</string>".html_safe
end
end
Dicas:
1. Certificar-se de que todo input está sendo escapado
Hugo Baraúna blog.plataformatec.com @hugobarauna
154. Helpers que retornam HTML
module ApplicationHelper
def strong(content)
"<strong>#{h content}</string>".html_safe
end
end
Dicas:
1. Certificar-se de que todo input está sendo escapado
2. Chamar html_safe no output
Hugo Baraúna blog.plataformatec.com @hugobarauna
155. Tem muito mais aqui!
http://github.com/plataformatec
Hugo Baraúna blog.plataformatec.com @hugobarauna
156. Tem muito mais aqui!
http://github.com/plataformatec
ID blog twitter
Hugo Baraúna blog.plataformatec.com @hugobarauna