0
0
Ruby on Railsframework~10 mins

N+1 detection tools in Ruby on Rails - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable the Bullet gem in a Rails initializer.

Ruby on Rails
Bullet.enable = [1]
Drag options to blanks, or click blank then click option'
Anil
Bfalse
C0
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Setting Bullet.enable to false disables detection.
Using nil or 0 will not enable Bullet.
2fill in blank
medium

Complete the code to add Bullet's notification to the Rails log.

Ruby on Rails
Bullet.[1] = true
Drag options to blanks, or click blank then click option'
Arails_logger
Badd_footer
Cbullet_logger
Draise
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raise' causes exceptions instead of logging.
Using 'bullet_logger' or 'add_footer' uses different logging or display methods.
3fill in blank
hard

Fix the error in the Bullet configuration to enable browser alerts.

Ruby on Rails
Bullet.[1] = true
Drag options to blanks, or click blank then click option'
Aadd_footer
Benable
Calert
Draise
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add_footer' adds info to page footer, not alerts.
Using 'raise' causes exceptions, not alerts.
4fill in blank
hard

Fill both blanks to configure Bullet to add notifications to the page footer and raise errors.

Ruby on Rails
Bullet.[1] = true
Bullet.[2] = true
Drag options to blanks, or click blank then click option'
Aadd_footer
Balert
Craise
Denable
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'alert' with 'add_footer'.
Using 'enable' instead of 'raise' for errors.
5fill in blank
hard

Fill all three blanks to configure Bullet to enable detection, log to Rails logger, and show browser alerts.

Ruby on Rails
Bullet.[1] = true
Bullet.[2] = true
Bullet.[3] = true
Drag options to blanks, or click blank then click option'
Aenable
Brails_logger
Calert
Draise
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raise' instead of 'alert' for browser popups.
Forgetting to enable Bullet detection.