SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Ruby on Rails Pitfall
  Or just stupid mistakes we made

                                        Robin Lu
                                   IN-SRC Studio
                              robinlu@in-src.com
                              RubyConfChina2009
IN-SRC Studio

• http://www.in-src.com
• Team behind Caibangzi.com
• Full stack Ruby On Rails Development
• Projects from Pepboys,Vitality, Healthwise...
‘and’ or ‘&&’
What does this mean?
   result = func(arg) and render(:text => result)
‘and’ or ‘&&’
What does this mean?
   result = func(arg) and render(:text => result)

Why not this?
   result = func(arg) && render(:text => result)
‘and’ or ‘&&’
What does this mean?
   result = func(arg) and render(:text => result)

Why not this?
   result = func(arg) && render(:text => result)

Be aware of the operator precedence
strip_tags

   Display user input text without tags

What we did:
strip_tags
When
    text =
      ‘<img title="http://example.com/x.js?" src="#"’

the page becomes:

<p> <img title="http://example.com/x.js?" src="#" </p>
strip_tags

strip_tags is not safe by itself

      h strip_tags(text)
cache
class Blog1Controller < ApplicationController
   def list
     unless read_fragment(:action => 'list')
        @articles = Article.nd_recent          Controller
     end
   end
end

<% cache do %>
 <ul>
 <% for article in @articles -%>
    <li><p><%= h(article.body) %></p></li>      list.html.erb
 <% end -%>
 </ul>
<% end %>
cache
Result:
     sometime got crash due to
       uninitialized @articles
cache
article list
cache
 article list

check cache
cache
 article list

check cache       list
cache
 article list

check cache       list


  render
cache
 article list            article new

check cache       list


  render
cache
 article list            article new

check cache       list   expire cache

  render
cache
 article list            article new

check cache       list   expire cache

  render
cache
 article list            article new

check cache       list   expire cache

  render

check cache
cache
    article list             article new

   check cache        list   expire cache

      render

   check cache

crashed by non-init
     @articles
cache
Solutions?

  • defensive: handle the exception
  • postpone init of @articles
  • update caches instead of expiring them
         none of them is perfect
object id
object id
Check nil? everywhere?
object id
cong.whiny_nil = true
validate_uniqueness_of
validate_uniqueness_of
We always get errors like this:

A ActiveRecord::StatementInvalid occurred in
fund#add_watch_fund:

 Mysql::Error: Duplicate entry '1234-271' for key 2:
INSERT INTO `watch_funds` (`account_id`,
`position`, `fund_id`, `created_at`) VALUES(1234, 19,
271, '2009-05-06 19:13:50')
validate_uniqueness_of
 Process A
               Process B
validate_uniqueness_of
 Process A
               Process B

  unique?
validate_uniqueness_of
 Process A
                           Process B

  unique?    select ....
validate_uniqueness_of
 Process A
                           Process B

  unique?    select ....
                            unique?
validate_uniqueness_of
 Process A
                           Process B

  unique?    select ....
                            unique?


  Insert
validate_uniqueness_of
 Process A
                           Process B

  unique?    select ....
                            unique?


  Insert
                            Insert
validate_uniqueness_of
 Process A
                           Process B

  unique?    select ....
                            unique?


  Insert
                            Insert

                           crash!
validate_uniqueness_of

  validate_uniqueness_of may not
     guarantee the uniqueness

use your own lock if the uniqueness is
           critical to you.
conditions
Background:
  • category has many subcategories
  • subcategory has many posts
  • post belongs to subcategory
we need to select all posts in a category.
conditions
What we did:
named_scope :in_category, lambda { |cat|
  conditions = [cat.subcategories.map {|subcat|
      'posts.subcategory_id = ?'
  }.join(" OR ")]
  cat.subcategories.each {|subcat|
      conditions << subcat.id }
  {:conditions => conditions}
}
conditions
Result:
  we get all posts when a category has no
               subcategories
conditions
When category has no subcategory
named_scope :in_category, lambda { |cat|
  conditions = [cat.subcategories.map {|subcat|
      'posts.subcategory_id = ?'
  }.join(" OR ")]
  cat.subcategories.each {|subcat|
      conditions << subcat.id }
  {:conditions => conditions}
}
conditions

 When you compose conditions, be
  aware that sometime nothing to
         compose means
the conditions should match nothing,
not the conditions should be empty.
before_create
   set a flag if the author of the post is an admin

What we did:
before_create
Result:

     Only post by admin can be saved
before_create


      All these callbacks are Filters
Be careful not to break the lter chain by
    what you return from the lters!
after_create
   send a mail whenever a new record is created

What we did:
after_create
Result:
  sometime the record save failed but we
         still get mail notication
after_create
   before_create              begin
                              ...
       create                 ...
                              commit
    after_create

all in one transaction   all the steps between this
                          should be transactional
after_create
What are non-transactional actions?
• send a mail
• delete a file
• expire a cache
after_create

• try not put non-transaction actions into
  transactions.
  • after_commit
  • in controller
Thanks!

Weitere ähnliche Inhalte

Was ist angesagt?

How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiRan Mizrahi
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScriptYakov Fain
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...Applitools
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片cfc
 
Cache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationCache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationWolfram Arnold
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Coupa Software
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Ran Mizrahi
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unitsitecrafting
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project WonderWO Community
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentationnishasowdri
 
RSpec 2 Best practices
RSpec 2 Best practicesRSpec 2 Best practices
RSpec 2 Best practicesAndrea Reginato
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developersYakov Fain
 
Alloy Tips & Tricks #TiLon
Alloy Tips & Tricks #TiLonAlloy Tips & Tricks #TiLon
Alloy Tips & Tricks #TiLonFokke Zandbergen
 
React Native Workshop - React Alicante
React Native Workshop - React AlicanteReact Native Workshop - React Alicante
React Native Workshop - React AlicanteIgnacio MartĂ­n
 
Take Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorksTake Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorksNodejsFoundation
 

Was ist angesagt? (20)

How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran Mizrahi
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...
Visual Testing: Turbo-Charge Your Functional Tests with Visual Powers in Just...
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片
 
Cache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationCache Money Talk: Practical Application
Cache Money Talk: Practical Application
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
React & Redux
React & ReduxReact & Redux
React & Redux
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unit
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project Wonder
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentation
 
Angular Testing
Angular TestingAngular Testing
Angular Testing
 
Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
 
RSpec 2 Best practices
RSpec 2 Best practicesRSpec 2 Best practices
RSpec 2 Best practices
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
 
Java script basics
Java script basicsJava script basics
Java script basics
 
Alloy Tips & Tricks #TiLon
Alloy Tips & Tricks #TiLonAlloy Tips & Tricks #TiLon
Alloy Tips & Tricks #TiLon
 
React Native Workshop - React Alicante
React Native Workshop - React AlicanteReact Native Workshop - React Alicante
React Native Workshop - React Alicante
 
Take Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorksTake Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorks
 

Andere mochten auch

Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBGrey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBWilliam Brant
 
Greytower identity Overview
Greytower identity  OverviewGreytower identity  Overview
Greytower identity OverviewWilliam Brant
 
Хостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхХостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхwebdrv
 
How we build caibangzi.com
How we build caibangzi.comHow we build caibangzi.com
How we build caibangzi.comRobin Lu
 
Technologypowerpoint
TechnologypowerpointTechnologypowerpoint
Technologypowerpointguest242124f
 
Домен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииДомен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииwebdrv
 
Professional Work
Professional WorkProfessional Work
Professional Workonite
 
Project Slide Show
Project Slide ShowProject Slide Show
Project Slide Showonite
 
Blocks & Grand Central Dispatch
Blocks & Grand Central DispatchBlocks & Grand Central Dispatch
Blocks & Grand Central DispatchRobin Lu
 
High quality iOS development
High quality iOS developmentHigh quality iOS development
High quality iOS developmentRobin Lu
 
Cocoa Design Patterns
Cocoa Design PatternsCocoa Design Patterns
Cocoa Design PatternsRobin Lu
 
Orient Advertising, Profile
Orient Advertising, ProfileOrient Advertising, Profile
Orient Advertising, ProfileHenna Shaykh
 
Khi internation food fest 2012 - for media partner
Khi internation food fest   2012 - for media partnerKhi internation food fest   2012 - for media partner
Khi internation food fest 2012 - for media partnerHenna Shaykh
 
Orient Advertising - Profile
Orient Advertising - ProfileOrient Advertising - Profile
Orient Advertising - ProfileHenna Shaykh
 
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2  per utenti Symfony 1.x: Architettura, modelli ed esempiSymfony2  per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempiFilippo De Santis
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablitiesWilliam Brant
 
Suggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanSuggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanKaan Caliskan
 
Arquitectura I Escultura Grega
Arquitectura I Escultura GregaArquitectura I Escultura Grega
Arquitectura I Escultura Gregaguestd4825b
 
Digitaalinen turvallisuus muuttuvassa ympäristÜssä
Digitaalinen turvallisuus muuttuvassa ympäristÜssäDigitaalinen turvallisuus muuttuvassa ympäristÜssä
Digitaalinen turvallisuus muuttuvassa ympäristÜssäjapijapi
 

Andere mochten auch (20)

Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESBGrey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
Grey tower and NetIQ - Identity Manager Integration with MuleSoft ESB
 
Greytower identity Overview
Greytower identity  OverviewGreytower identity  Overview
Greytower identity Overview
 
Хостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данныхХостеры и регистраторы - операторы персональных данных
Хостеры и регистраторы - операторы персональных данных
 
How we build caibangzi.com
How we build caibangzi.comHow we build caibangzi.com
How we build caibangzi.com
 
Technologypowerpoint
TechnologypowerpointTechnologypowerpoint
Technologypowerpoint
 
Домен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникацииДомен .tel - новый способ коммуникации
Домен .tel - новый способ коммуникации
 
Professional Work
Professional WorkProfessional Work
Professional Work
 
Project Slide Show
Project Slide ShowProject Slide Show
Project Slide Show
 
Blocks & Grand Central Dispatch
Blocks & Grand Central DispatchBlocks & Grand Central Dispatch
Blocks & Grand Central Dispatch
 
High quality iOS development
High quality iOS developmentHigh quality iOS development
High quality iOS development
 
Cocoa Design Patterns
Cocoa Design PatternsCocoa Design Patterns
Cocoa Design Patterns
 
Orient Advertising, Profile
Orient Advertising, ProfileOrient Advertising, Profile
Orient Advertising, Profile
 
Khi internation food fest 2012 - for media partner
Khi internation food fest   2012 - for media partnerKhi internation food fest   2012 - for media partner
Khi internation food fest 2012 - for media partner
 
Orient Advertising - Profile
Orient Advertising - ProfileOrient Advertising - Profile
Orient Advertising - Profile
 
Gastcollege CHE
Gastcollege CHEGastcollege CHE
Gastcollege CHE
 
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2  per utenti Symfony 1.x: Architettura, modelli ed esempiSymfony2  per utenti Symfony 1.x: Architettura, modelli ed esempi
Symfony2 per utenti Symfony 1.x: Architettura, modelli ed esempi
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablities
 
Suggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOceanSuggestions and Ideas for DigitalOcean
Suggestions and Ideas for DigitalOcean
 
Arquitectura I Escultura Grega
Arquitectura I Escultura GregaArquitectura I Escultura Grega
Arquitectura I Escultura Grega
 
Digitaalinen turvallisuus muuttuvassa ympäristÜssä
Digitaalinen turvallisuus muuttuvassa ympäristÜssäDigitaalinen turvallisuus muuttuvassa ympäristÜssä
Digitaalinen turvallisuus muuttuvassa ympäristÜssä
 

Ähnlich wie Ruby On Rails Pitfalls

Continuous Integration For Rails Project
Continuous Integration For Rails ProjectContinuous Integration For Rails Project
Continuous Integration For Rails ProjectLouie Zhao
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Railsrstankov
 
Ruby For Startups
Ruby For StartupsRuby For Startups
Ruby For StartupsMike Subelsky
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatternsChul Ju Hong
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-publicChul Ju Hong
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aopDror Helper
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD WorkshopWolfram Arnold
 
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...WordCamp Sydney
 
Django Pro ORM
Django Pro ORMDjango Pro ORM
Django Pro ORMAlex Gaynor
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress DeveloperJoey Kudish
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::ManagerJay Shirley
 
Rails OO views
Rails OO viewsRails OO views
Rails OO viewsElia Schito
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHPMarcos Quesada
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialYi-Ting Cheng
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalkHiroshi SHIBATA
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on RailsMark Menard
 

Ähnlich wie Ruby On Rails Pitfalls (20)

Continuous Integration For Rails Project
Continuous Integration For Rails ProjectContinuous Integration For Rails Project
Continuous Integration For Rails Project
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
Ruby For Startups
Ruby For StartupsRuby For Startups
Ruby For Startups
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aop
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop
 
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
 
Django Pro ORM
Django Pro ORMDjango Pro ORM
Django Pro ORM
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::Manager
 
Rails OO views
Rails OO viewsRails OO views
Rails OO views
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalk
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 

KĂźrzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 

KĂźrzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Ruby On Rails Pitfalls

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. action controller &amp;#x76F8;&amp;#x5173;&amp;#x7684;&amp;#x95EE;&amp;#x9898;\nAnything you place in the flash will be exposed to the very next action and then cleared out.\n
  6. Anything you place in the flash will be exposed to the very next action and then cleared out.\n
  7. \n
  8. action view&amp;#x76F8;&amp;#x5173;\n
  9. &amp;#x5728;&amp;#x4E00;&amp;#x4E9B;&amp;#x6709;&amp;#x7279;&amp;#x6B8A;&amp;#x5BB9;&amp;#x9519;&amp;#x7279;&amp;#x6027;&amp;#x7684;&amp;#x6D4F;&amp;#x89C8;&amp;#x5668;&amp;#x4E2D;,&amp;#x6BD4;&amp;#x5982;IE 6.0\n&amp;#x4E0D;&amp;#x5B8C;&amp;#x6574;&amp;#x7684;tag&amp;#x4F1A;&amp;#x88AB;&amp;#x62FC;&amp;#x6210;&amp;#x4E00;&amp;#x4E2A;&amp;#x5B8C;&amp;#x6574;&amp;#x7684;tag.\n\n
  10. not safe sanitizer:HTML::FullSanitizer\nsafe sanitizer:HTML::WhiteListSanitizer\n
  11. controller + view\n&amp;#x4EE3;&amp;#x7801;&amp;#x6765;&amp;#x6E90;&amp;#x4E8E;Agile Web Development With Rails\n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. active record&amp;#x76F8;&amp;#x5173;\n
  26. \n
  27. when there&amp;#x2019;s no table lock\n
  28. when there&amp;#x2019;s no table lock\n
  29. when there&amp;#x2019;s no table lock\n
  30. when there&amp;#x2019;s no table lock\n
  31. when there&amp;#x2019;s no table lock\n
  32. when there&amp;#x2019;s no table lock\n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. &amp;#x5982;&amp;#x679C;conditions&amp;#x662F;&amp;#x7EC4;&amp;#x5408;&amp;#x800C;&amp;#x6210;&amp;#x7684;,&amp;#x8981;&amp;#x6CE8;&amp;#x610F;&amp;#x662F;&amp;#x5426;&amp;#x6709;&amp;#x7EC4;&amp;#x5408;&amp;#x5185;&amp;#x5BB9;&amp;#x4E3A;&amp;#x7A7A;&amp;#x7684;&amp;#x60C5;&amp;#x51B5;.&amp;#x7EC4;&amp;#x5408;&amp;#x5185;&amp;#x5BB9;&amp;#x4E3A;&amp;#x7A7A;,conditions&amp;#x4E0D;&amp;#x80FD;&amp;#x4E3A;&amp;#x7A7A;.&amp;#x5426;&amp;#x5219;,&amp;#x53EF;&amp;#x80FD;&amp;#x5F97;&amp;#x5230;&amp;#x5B8C;&amp;#x5168;&amp;#x76F8;&amp;#x53CD;&amp;#x7684;&amp;#x7ED3;&amp;#x679C;.\n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. otherwise, something strange could happen\n
  45. \n
  46. \n
  47. \n