Advanced Rails

Advanced Rails

Brad Ediger

Language: English

Pages: 360

ISBN: 0596510322

Format: PDF / Kindle (mobi) / ePub


Ready to go to the next level with Rails? From examining the parts of Ruby that make this framework possible to deploying large Rails applications, Advanced Rails offers you an in-depth look at techniques for dealing with databases, security, performance, web services and much more.

Chapters in this book help you understand not only the tricks and techniques used within the Rails framework itself, but also how to make use of ideas borrowed from other programming paradigms. Advanced Rails pays particular attention to building applications that scale -- whether "scale" means handling more users, or working with a bigger and more complex database. You'll find plenty of examples and code samples that explain:

  • Aspects of Ruby that are often confusing or misunderstood
  • Metaprogramming
  • How to develop Rails plug-ins
  • Different database management systems
  • Advanced database features, including triggers, rules, and stored procedures
  • How to connect to multiple databases
  • When to use the Active Support library for generic, reusable functions
  • Security principles for web application design, and security issues endemic to the Web
  • When and when not to optimize performance
  • Why version control and issue tracking systems are essential to any large or long-lived Rails project

Advanced Rails also gives you a look at REST for developing web services, ways to incorporate and extend Rails, how to use internationalization, and many other topics. If you're just starting out with rails, or merely experimenting with the framework, this book is not for you. But if you want to improve your skills with Rails through advanced techniques, this book is essential.

Web Design All-In-One for Dummies (2nd Edition)

Sass and Compass for Designers (Community Experience Distilled)

Drupal 7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright 2008 Brad Ediger, 978-0-596-51032-9." If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O'Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page

.../gems/ruport-1.2.0/lib/ruport/data/table.rb:807 when Array (rdb:1) .../gems/ruport-1.2.0/lib/ruport/data/table.rb:810 when /\.csv/ (rdb:1) c $ The debugger has many other commands and features. Breakpoints can be set and cleared on arbitrary lines or methods, and they can be conditional: (rdb:1) break table.rb:805 if args.first =~ /\.csv/ Set breakpoint 1 at table.rb:805 (rdb:1) c Breakpoint 1 at table.rb:805 .../gems/ruport-1.2.0/lib/ruport/data/table.rb:805 table= (rdb:1) The

m_tbl of that class object for a matching method. (The target of a klass pointer will always be a class object.) If no method is found, Ruby follows that class object's super pointer and continues the search in the superclass's m_tbl. Ruby progresses in this manner until the method is found or the top of the super chain is reached. If the method is not found in any object on the chain, Ruby invokes method_ missing on the receiver of the original method. This starts the process over

(even though, in this case, the foreign key is composed of two attributes). This can be confusing if you don't consider the way the relationship is represented in the schema, because the foreign_key option defined in Order's has_many :line_items statement actually refers to attributes of LineItem. As a final touch, we can set things up so that we don't have to worry about the keys at all in code. Remember that the original reason for using composite keys was to allow us to use independent

method call, and are not automatically objects. For example, you cannot say code_ block ={puts"abc"}. This is what the Kernel#lambda and Proc.new functions are for: converting blocks to Procs. [9] block_1 = lambda { puts "abc" } # => # block_2 = Proc.new { puts "abc" } # => # There is a slight difference between Kernel#lambda and Proc.new. Returning from a Proc created with Kernel#lambda returns the given value to the calling function; returning

Download sample

Download