O'Reilly logo

Learning Rails: Live Edition by Edd Dumbill, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Your Knowledge

Quiz

  1. How can you sanitize information being passed to a SQL query so it can’t harm your database?

  2. What’s the simplest way to keep user-entered data from attacking other users’ browsers?

  3. How does switching to production mode affect caching?

  4. Where do you make changes to Rails’ production database configuration?

Answers

  1. Specifying the :conditions parameter as an array makes Rails take a closer look at incoming data to ensure that isn’t potentially damaging SQL.

  2. Applying the h method to all outgoing content is the simplest way to ensure that nothing awful gets through, though stripping all HTML tags is another similarly effective option.

  3. Rails caches heavily in production mode, helping you to maximize throughput while minimizing processing time.

  4. The config/database.yml file is the place to specify database information, including the type of database, where to connect to the database, and any authentication information.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required