The document discusses various aspects of Ruby on Rails including models, controllers, views, and deployment. It provides examples of modeling product data including associations between products, manufacturers, batches, and ingredients. It also demonstrates routing and filtering in controllers.
This is the 3rd of 8 presentations given at University of Texas during my Beginner to Builder Rails 3 Class. For more info and the whole series including video presentations at my blog:
http://schneems.tumblr.com/tagged/Rails-3-beginner-to-builder-2011
Introduction to Ruby and Introduction to Ruby on Rails basic concepts for beginners. The google presentation is even better in full screen https://docs.google.com/presentation/d/1EE0VuB_PkD2-8j5JNs6CUQHb4J9ToIgC7-IxYTojiS0/pub?start=false&loop=false&delayms=3000#slide=id.p
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
A couple of tricks you might not know about. Held at an internal developer show'n'tell in October 2010 at SilverStripe Ltd. in Wellington, New Zealand. Video available at http://vimeo.com/16446690
This is the 3rd of 8 presentations given at University of Texas during my Beginner to Builder Rails 3 Class. For more info and the whole series including video presentations at my blog:
http://schneems.tumblr.com/tagged/Rails-3-beginner-to-builder-2011
Introduction to Ruby and Introduction to Ruby on Rails basic concepts for beginners. The google presentation is even better in full screen https://docs.google.com/presentation/d/1EE0VuB_PkD2-8j5JNs6CUQHb4J9ToIgC7-IxYTojiS0/pub?start=false&loop=false&delayms=3000#slide=id.p
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
A couple of tricks you might not know about. Held at an internal developer show'n'tell in October 2010 at SilverStripe Ltd. in Wellington, New Zealand. Video available at http://vimeo.com/16446690
Object Identification and its management is heart of any test automation. this document explains different ways for object identification in selenium, and also importance of its maintenance.
Property Based Testing is an process to build robust systems.
It facilitates a deeper understanding of the system under test. It can be used on any testing level: unit, integration or functional.
The presentation introduces how Property Based Testing works, how to use it with PHPUnit, and in what way it differentiates from example based tests.
It talks about strategies to find good properties to check for.
This presentation was built for the Meet-Magento conference 2020 in Mumbai.
Odoo ERP is one of the best Open Source ERP until this year. Within this slide we are explain some of what we can enhance on the Odoo to get our goal on business requirements
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
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.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
13. Models ➤ Associations
# create a product and find its manufacturer
product = manufacturer.products.create({:name => "Kitlifter"})
product.manufacturer
# create a upc and find its product's manufacturer
upc = product.create_upc({:code => "001122"})
upc.product.manufacturer
# create a batch (linking a product and ingredient)
wheat = Ingredient.create({:name => "Wheat"})
bread = Product.create({:name => "Bread"})
batch.create({:product => bread, :ingredient => wheat})
Saturday, April 2, 2011
14. Models ➤ Associations
When should I use has_one
and belongs_to?
“Using has_many or belongs_to is more than
just on which table the foreign key is placed,
itʼs a matter of who can be thought of as
ʻowningʼ the other. A product ʻownsʼ a UPC.”
Saturday, April 2, 2011
15. Models ➤ Validations
class Product < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
validates_format_of :sku, :with => /^SKUd{8}$/
validates_inclusion_of :usda_rating, :in => %w( prime choice )
validate :cannot_be_active_if_recalled
def cannot_be_active_if_recalled
if recalled? && recalled_on < Date.today
errors.add(:active, "Can't be active if it's been recalled")
end
end
Saturday, April 2, 2011
16. Models ➤ Validations
I know my record is
technically invalid, but
I want to save it anyhow.
“It is possible to save a record,
without validating, by using
save(:validate => false)”
Saturday, April 2, 2011
17. Models ➤ Callbacks
class Ingredient
Callback
before_destroy :determine_destroyability Chain
before_create :format_legacy_name
after_update :log_changes
after_create :import_harvest_data
determine_destroyability
# validation
# create
# save
# update
# destroy
end
STOP!!
Saturday, April 2, 2011
18. Models ➤ Querying
Product.find(98)
Product.find_by_name("Diet Coke")
Product.find_by_name_and_sku("Diet Coke", "SKU44387")
Product.find([98,11,39])
Product.first
Product.last
Product.all
Product.count
# old and busted
Product.find(:all, :conditions => {:name => "Cheese-it!"})
# new hotness
Product.where(:name => "Cheese-it!").all
Saturday, April 2, 2011
21. Models ➤ Validations
Why would I use joins
instead of includes?
“Using includes will load the
records into memory when the query
is executing, joins will not.”
Saturday, April 2, 2011
22. Controllers
Routing
Filters
Conventions
Saturday, April 2, 2011
23. Controllers ➤ Routing
resources :products
# GET /products => index action
# GET /products/new => new action
# GET /products/:id => show action
# GET /products/:id/edit => edit action
#
# POST /products => create action
#
# PUT /products/:id => update action
#
# DELETE /products/:id => destroy action
products_path # /products
products_url # http://www.example.com/products
product_path(@product) # /products/29
product_path(@product, :xml) # /products/29.xml
Saturday, April 2, 2011
24. Controllers ➤ Routing
namespace :admin do
resources :users
resources :orders
end
admin_users_path # /admin/users
edit_admin_order_path # /admin/orders/4/edit
class Admin::UsersController < ApplicationController
# /app/controllers/admin/users_controller.rb
# /app/views/admin/users/
end
Saturday, April 2, 2011
25. Controllers ➤ Routing
resources :accounts, :except => :destroy do
resources :users do
post :activate, :on => :member
collection do
get 'newest'
end
end
resources :clients, :only => [:index, :show]
end
account_users_path(@account) # /accounts/182/users
newest_account_users_path(@account) # /accounts/182/users/newest
activate_account_user_path(@account, @user) # /accounts/182/user/941
accounts_clients_path(@account) # /accounts/182/clients
new_accounts_client_path(@account) # FAIL!
Saturday, April 2, 2011
26. Controllers ➤ Filters
class UsersController < ApplicationController
before_filter :load_manufacturer
before_filter :find_geo_data, :only => [:show]
skip_before_filter :require_login
after_filter :log_access
end
# in ApplicationController
def log_access
Rails.logger.info("[Access Log] Users Controller access at #{Time.now}")
end
Saturday, April 2, 2011
27. Controllers ➤ Conventions
class ProductsController < ApplicationController
def index
# GET /products
end def update
def show
# GET /products/:id
end
☹ # ... update occurred
@parent.children.each ...
end
def new
# GET /products/new
end
def edit
def create @product = Product.find(params[:id])
# POST /products end
☹
end
def show
def edit @product = Product.find(params[:id])
# GET /products/:id/edit
end
end
def destroy
def update
# PUT /products/:id @product = Product.find(params[:id])
end end
def destroy
# DELETE /products/:id
end
end
☺ before_filter :load_product
Saturday, April 2, 2011
28. Controllers ➤ Conventions
class ProductsController < ApplicationController
def index
# GET /products
end
def update
☹
def show
# GET /products/:id
# ... update occurred
# renders /app/views/products/show.format @parent.children.each ...
end end
def new
# GET /products/new
end
def edit
def create @product = Product.find(params[:id])
# POST /products end
☹
redirect_to products_url
end def show
@product = Product.find(params[:id])
def edit
end
# GET /products/:id/edit
end
def destroy
def update @product = Product.find(params[:id])
# PUT /products/:id end
end
def destroy
# DELETE /products/:id
end
☺ before_filter :load_product
end
Saturday, April 2, 2011
29. Views
Layouts & Helpers
Forms
Partials
ActionView Helpers
Saturday, April 2, 2011
30. Views ➤ Layouts & Helpers
def show
@product = Product.find(params[:id])
end M C
<!-- app/views/products/show.html.erb -->
<h2><%= @product.name %></h2>
V
<p>Price: <%= @product.price %></p>
<!-- app/layouts/application.html.erb -->
<div id="container">
<%= yield %>
</div>
<div id="container">
<h2>Pop-Tarts</h2>
<p>Price: $3.99</p>
</div>
Saturday, April 2, 2011
39. Resources for Learning
Video
PeepCode
RailsCasts
CodeSchool
Books
The Rails Way
Beginning Ruby
Ruby for _________
Other
PHX Rails User Group
Gangplank
Saturday, April 2, 2011
40. @claytonlz
http://spkr8.com/t/7007
Saturday, April 2, 2011