Rails Cookbook - Helion
ISBN: 978-05-965-5464-4
stron: 544, Format: ebook
Data wydania: 2007-01-16
Księgarnia: Helion
Cena książki: 118,15 zł (poprzednio: 137,38 zł)
Oszczędzasz: 14% (-19,23 zł)
Rails Cookbook is packed with the solutions you need to be a proficient developer with Rails, the leading framework for building the new generation of Web 2.0 applications. Recipes range from the basics, like installing Rails and setting up your development environment, to the latest techniques, such as developing RESTful web services.
With applications that are code light, feature-full and built to scale quickly, Rails has revolutionized web development. The Rails Cookbook addresses scores of real-world challenges; each one includes a tested solution, plus a discussion of how and why it works, so that you can adapt the techniques to similar situations. Topics include:
- Modeling data with the ActiveRecord library
- Setting up views with ActionView and RHTML templates
- Building your application's logic into ActionController
- Testing and debugging your Rails application
- Building responsive web applications using JavaScript and Ajax
- Ensuring that your application is security and performs well
- Deploying your application with Mongrel and Apache
- Using Capistrano to automate deployment
- Using the many Rails plugins
- Working with graphics
Whether you're new to Rails or an experienced developer, you'll discover ways to test, debug and secure your applications, incorporate Ajax, use caching to improve performance, and put your application into production. Want to get ahead of the Web 2.0 curve? This valuable cookbook will save you hundreds of hours when developing applications with Rails.
Osoby które kupowały "Rails Cookbook", wybierały także:
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Programowanie w języku Ruby. Mikrousługi i konteneryzacja 58,98 zł, (29,49 zł -50%)
- Rails. Sztuka programowania 58,98 zł, (29,49 zł -50%)
- Ruby on Rails. Od podstaw 49,00 zł, (24,50 zł -50%)
- Rails. Receptury 67,00 zł, (33,50 zł -50%)
Spis treści
Rails Cookbook. Recipes for Rapid Web Development with Ruby eBook -- spis treści
- Rails Cookbook
- SPECIAL OFFER: Upgrade this ebook with OReilly
- A Note Regarding Supplemental Files
- Foreword
- Preface
- Who This Book Is For
- Other Resources
- Web Sites
- Books
- Conventions Used in This Book
- Font Conventions
- Using Code Examples
- Safari Enabled
- Comments and Questions
- Acknowledgments
- 1. Getting Started
- Introduction
- Joining the Rails Community
- Problem
- Solution
- Discussion
- See Also
- Finding Documentation
- Problem
- Solution
- Discussion
- See Also
- Installing MySQL
- Problem
- Solution
- Windows
- Linux
- Mac OS X
- Discussion
- See Also
- Installing PostgreSQL
- Problem
- Solution
- Windows
- Linux
- Mac OS X
- Discussion
- See Also
- Installing Rails
- Problem
- Solution
- Discussion
- See Also
- Fixing Ruby and Installing Rails on OS X 10.4 Tiger
- Problem
- Solution
- Discussion
- See Also
- Running Rails in OS X with Locomotive
- Problem
- Solution
- Discussion
- See Also
- Running Rails in Windows with Instant Rails
- Problem
- Solution
- Discussion
- See Also
- Updating Rails with RubyGems
- Problem
- Solution
- Discussion
- See Also
- Getting Your Rails Project into Subversion
- Problem
- Solution
- Discussion
- See Also
- 2. Rails Development
- Introduction
- Creating a Rails Project
- Problem
- Solution
- Discussion
- See Also
- Jump-Starting Development with Scaffolding
- Problem
- Solution
- Discussion
- See Also
- Speeding Up Rails Development with Mongrel
- Problem
- Solution
- Discussion
- See Also
- Enhancing Windows Development with Cygwin
- Problem
- Solution
- Discussion
- See Also
- Understanding Pluralization Patterns in Rails
- Problem
- Solution
- Discussion
- See Also
- Developing Rails in OS X with TextMate
- Problem
- Solution
- Discussion
- See Also
- Cross-Platform Developing with RadRails
- Problem
- Solution
- Discussion
- See Also
- Installing and Running Edge Rails
- Problem
- Solution
- Discussion
- See Also
- Setting Up Passwordless Authentication with SSH
- Problem
- Solution
- Discussion
- See Also
- Generating RDoc for Your Rails Application
- Problem
- Solution
- Discussion
- See Also
- Creating Full-Featured CRUD Applications with Streamlined
- Problem
- Solution
- Discussion
- See Also
- 3. Active Record
- Introduction
- Setting Up a Relational Database to Use with Rails
- Problem
- Solution
- Discussion
- See Also
- Programmatically Defining Database Schema
- Problem
- Solution
- Discussion
- See Also
- Developing Your Database with Migrations
- Problem
- Solution
- Discussion
- See Also
- Modeling a Database with Active Record
- Problem
- Solution
- Discussion
- See Also
- Inspecting Model Relationships from the Rails Console
- Problem
- Solution
- Discussion
- See Also
- Accessing Your Data via Active Record
- Problem
- Solution
- Discussion
- See Also
- Retrieving Records with find
- Problem
- Solution
- Discussion
- See Also
- Iterating Over an Active Record Result Set
- Problem
- Solution
- Discussion
- See Also
- Retrieving Data Efficiently with Eager Loading
- Problem
- Solution
- Discussion
- See Also
- Updating an Active Record Object
- Problem
- Solution
- Discussion
- See Also
- Enforcing Data Integrity with Active Record Validations
- Problem
- Solution
- Discussion
- See Also
- Executing Custom Queries with find_by_sql
- Problem
- Solution
- Discussion
- See Also
- Protecting Against Race Conditions with Transactions
- Problem
- Solution
- Discussion
- See Also
- Adding Sort Capabilities to a Model with acts_as_list
- Problem
- Solution
- Discussion
- See Also
- Performing a Task Whenever a Model Object Is Created
- Problem
- Solution
- Discussion
- See Also
- Modeling a Threaded Forum with acts_as_nested_set
- Problem
- Solution
- Discussion
- See Also
- Creating a Directory of Nested Topics with acts_as_tree
- Problem
- Solution
- Discussion
- See Also
- Avoiding Race Conditions with Optimistic Locking
- Problem
- Solution
- Discussion
- See Also
- Handling Tables with Legacy Naming Conventions
- Problem
- Solution
- Discussion
- Automating Record Timestamping
- Problem
- Solution
- Discussion
- See Also
- Factoring Out Common Relationships with Polymorphic Associations
- Problem
- Solution
- Discussion
- See Also
- Mixing Join Models and Polymorphism for Flexible Data Modeling
- Problem
- Solution
- Discussion
- See Also
- 4. Action Controller
- Introduction
- Accessing Form Data from a Controller
- Problem
- Solution
- Discussion
- See Also
- Changing an Applications Default Page
- Problem
- Solution
- Discussion
- See Also
- Clarifying Your Code with Named Routes
- Problem
- Solution
- Discussion
- See Also
- Configuring Customized Routing Behavior
- Problem
- Solution
- Discussion
- See Also
- Displaying Alert Messages with Flash
- Problem
- Solution
- Discussion
- See Also
- Extending the Life of a Flash Message
- Problem
- Solution
- Discussion
- See Also
- Following Actions with Redirects
- Problem
- Solution
- Discussion
- See Also
- Generating URLs Dynamically
- Problem
- Solution
- Discussion
- See Also
- Inspecting Requests with Filters
- Problem
- Solution
- Discussion
- See Also
- Logging with Filters
- Problem
- Solution
- Discussion
- See Also
- Rendering Actions
- Problem
- Solution
- Discussion
- See Also
- Restricting Access to Controller Methods
- Problem
- Solution
- Discussion
- See Also
- Sending Files or Data Streams to the Browser
- Problem
- Solution
- Discussion
- See Also
- Storing Session Information in a Database
- Problem
- Solution
- Discussion
- See Also
- Tracking Information with Sessions
- Problem
- Solution
- Discussion
- See Also
- Using Filters for Authentication
- Problem
- Solution
- Discussion
- See Also
- 5. Action View
- Introduction
- Simplifying Templates with View Helpers
- Problem
- Solution
- Discussion
- See Also
- Displaying Large Datasets with Pagination
- Problem
- Solution
- Discussion
- See Also
- Creating a Sticky Select List
- Problem
- Solution
- Discussion
- See Also
- Editing Many-to-Many Relationships with Multiselect Lists
- Problem
- Solution
- Discussion
- See Also
- Factoring Out Common Display Code with Layouts
- Problem
- Solution
- Discussion
- See Also
- Defining a Default Application Layout
- Problem
- Solution
- Discussion
- See Also
- Generating XML with Builder Templates
- Problem
- Solution
- Discussion
- See Also
- Generating RSS Feeds from Active Record Data
- Problem
- Solution
- Discussion
- See Also
- Reusing Page Elements with Partials
- Problem
- Solution
- Discussion
- See Also
- Processing Dynamically Created Input Fields
- Problem
- Solution
- Discussion
- See Also
- Customizing the Behavior of Standard Helpers
- Problem
- Solution
- Discussion
- Creating a Web Form with Form Helpers
- Problem
- Solution
- Discussion
- See Also
- Formatting Dates, Times, and Currencies
- Problem
- Solution
- Discussion
- See Also
- Personalizing User Profiles with Gravatars
- Problem
- Solution
- Discussion
- See Also
- Avoiding Harmful Code in Views with Liquid Templates
- Problem
- Solution
- Discussion
- See Also
- Globalizing Your Rails Application
- Problem
- Solution
- Discussion
- See Also
- 6. RESTful Development
- Introduction
- REST Is a Conversation
- REST Is Design
- Rails and REST
- Creating Nested Resources
- Problem
- Solution
- Discussion
- See Also
- Supporting Alternative Data Formats by MIME Type
- Problem
- Solution
- Discussion
- See Also
- Modeling Relationships RESTfully with Join Models
- Problem
- Solution
- Discussion
- Moving Beyond Simple CRUD with RESTful Resources
- Problem
- Solution
- Discussion
- See Also
- Consuming Complex Nested REST Resources
- Problem
- Solution
- Discussion
- See Also
- Developing Your Rails Applications RESTfully
- Problem
- Solution
- Discussion
- See Also
- Introduction
- 7. Rails Application Testing
- Introduction
- Centralizing the Creation of Objects Common to Test Cases
- Problem
- Solution
- Discussion
- Creating Fixtures for Many-to-Many Associations
- Problem
- Solution
- Discussion
- See Also
- Importing Test Data with CSV Fixtures
- Problem
- Solution
- Discussion
- See Also
- Including Dynamic Data in Fixtures with ERb
- Problem
- Solution
- Discussion
- See Also
- Initializing a Test Database
- Problem
- Solution
- Discussion
- See Also
- Interactively Testing Controllers from the Rails Console
- Problem
- Solution
- Discussion
- See Also
- Interpreting the Output of Test::Unit
- Problem
- Solution
- Discussion
- See Also
- Loading Test Data with YAML Fixtures
- Problem
- Solution
- Discussion
- See Also
- Monitoring Test Coverage with rake stats
- Problem
- Solution
- Discussion
- See Also
- Running Tests with Rake
- Problem
- Solution
- Discussion
- See Also
- Speeding Up Tests with Transactional Fixtures
- Problem
- Solution
- Discussion
- See Also
- Testing Across Controllers with Integration Tests
- Problem
- Solution
- Discussion
- See Also
- Testing Controllers with Functional Tests
- Problem
- Solution
- Discussion
- See Also
- Examining the Contents of Cookie
- Problem
- Solution
- Discussion
- See Also
- Testing Custom and Named Routes
- Problem
- Solution
- Discussion
- See Also
- Testing HTTP Requests with Response-Related Assertions
- Problem
- Solution
- Discussion
- See Also
- Testing a Model with Unit Tests
- Problem
- Solution
- Discussion
- See Also
- Unit Testing Model Validations
- Problem
- Solution
- Discussion
- See Also
- Verifying DOM Structure with Tag-Related Assertions
- Problem
- Solution
- Discussion
- See Also
- Writing Custom Assertions
- Problem
- Solution
- Discussion
- See Also
- Testing File Upload
- Problem
- Solution
- Discussion
- See Also
- Modifying the Default Behavior of a Class for Testing by Using Mocks
- Problem
- Solution
- Discussion
- See Also
- Improving Feedback by Running Tests Continuously
- Problem
- Solution
- Discussion
- See Also
- Analyzing Code Coverage with Rcov
- Problem
- Solution
- Discussion
- See Also
- 8. JavaScript and Ajax
- Introduction
- Adding DOM Elements to a Page
- Problem
- Solution
- Discussion
- See Also
- Creating a Custom Report with Drag and Drop
- Problem
- Solution
- Discussion
- See Also
- Dynamically Adding Items to a Select List
- Problem
- Solution
- Discussion
- Monitoring the Content Length of a Textarea
- Problem
- Solution
- Discussion
- See Also
- Updating Page Elements with RJS Templates
- Problem
- Solution
- Discussion
- Inserting JavaScript into Templates
- Problem
- Solution
- Discussion
- See Also
- Letting a User Reorder a List
- Problem
- Solution
- Discussion
- See Also
- Autocompleting a Text Field
- Problem
- Solution
- Discussion
- See Also
- Searching for and Highlighting Text Dynamically
- Problem
- Solution
- Discussion
- See Also
- Enhancing the User Interface with Visual Effects
- Problem
- Solution
- Discussion
- See Also
- Implementing a Live Search
- Problem
- Solution
- Discussion
- See Also
- Editing Fields in Place
- Problem
- Solution
- Discussion
- See Also
- Creating an Ajax Progress Indicator
- Problem
- Solution
- Discussion
- 9. Action Mailer
- Introduction
- Configuring Rails to Send Email
- Problem
- Solution
- Discussion
- See Also
- Creating a Custom Mailer Class with the Mailer Generator
- Problem
- Solution
- Discussion
- See Also
- Formatting Email Messages Using Templates
- Problem
- Solution
- Discussion
- See Also
- Attaching Files to Email Messages
- Problem
- Solution
- Discussion
- See Also
- Sending Email from a Rails Application
- Problem
- Solution
- Discussion
- See Also
- Receiving Email with Action Mailer
- Problem
- Solution
- Discussion
- See Also
- 10. Debugging Rails Applications
- Introduction
- Exploring Rails from the Console
- Problem
- Solution
- Discussion
- See Also
- Fixing Bugs at the Source with Ruby -cw
- Problem
- Solution
- Discussion
- See Also
- Debugging Your Application in Real Time with the breakpointer
- Problem
- Solution
- Discussion
- See Also
- Logging with the Built-in Rails Logger Class
- Problem
- Solution
- Discussion
- See Also
- Writing Debugging Information to a File
- Problem
- Solution
- Discussion
- See Also
- Emailing Application Exceptions
- Problem
- Solution
- Discussion
- See Also
- Outputting Environment Information in Views
- Problem
- Solution
- Discussion
- See Also
- Displaying Object Contents with Exceptions
- Problem
- Solution
- Discussion
- See Also
- Filtering Development Logs in Real Time
- Problem
- Solution
- Discussion
- See Also
- Debugging HTTP Communication with Firefox Extensions
- Problem
- Solution
- Discussion
- See Also
- Debugging Your JavaScript in Real Time with the JavaScript Shell
- Problem
- Solution
- Discussion
- See Also
- Debugging Your Code Interactively with ruby-debug
- Problem
- Solution
- Discussion
- See Also
- 11. Security
- Introduction
- Hardening Your Systems with Strong Passwords
- Problem
- Solution
- Discussion
- See Also
- Protecting Queries from SQL Injection
- Problem
- Solution
- Discussion
- See Also
- Guarding Against Cross-Site Scripting Attacks
- Problem
- Solution
- Discussion
- See Also
- Restricting Access to Public Methods or Actions
- Problem
- Solution
- Discussion
- See Also
- Securing Your Server by Closing Unnecessary Ports
- Problem
- Solution
- Discussion
- See Also
- 12. Performance
- Introduction
- Measuring Web Server Performance with Httperf
- Problem
- Solution
- Discussion
- See Also
- Benchmarking Portions of Your Application Code
- Problem
- Solution
- Discussion
- See Also
- Improving Performance by Caching Static Pages
- Problem
- Solution
- Discussion
- See Also
- Expiring Cached Pages
- Problem
- Solution
- Discussion
- See Also
- Mixing Static and Dynamic Content with Fragment Caching
- Problem
- Solution
- Discussion
- See Also
- Filtering Cached Pages with Action Caching
- Problem
- Solution
- Discussion
- See Also
- Speeding Up Data Access Times with memcached
- Problem
- Solution
- Discussion
- See Also
- Increasing Performance by Caching Post-Processed Content
- Problem
- Solution
- Discussion
- See Also
- 13. Hosting and Deployment
- Introduction
- Hosting Rails Using Apache 1.3 and mod_fastcgi
- Problem
- Solution
- Discussion
- See Also
- Managing Multiple Mongrel Processes with mongrel_cluster
- Problem
- Solution
- Discussion
- See Also
- Hosting Rails with Apache 2.2, mod_proxy_balancer, and Mongrel
- Problem
- Solution
- Discussion
- See Also
- Deploying Rails with Pound in Front of Mongrel, Lighttpd, and Apache
- Problem
- Solution
- Discussion
- See Also
- Customizing Pounds Logging with cronolog
- Problem
- Solution
- Discussion
- See Also
- Configuring Pound with SSL Support
- Problem
- Solution
- Discussion
- See Also
- Simple Load Balancing with Pen
- Problem
- Solution
- Discussion
- See Also
- Deploying Your Rails Project with Capistrano
- Problem
- Solution
- Discussion
- See Also
- Deploying Your Application to Multiple Environments with Capistrano
- Problem
- Solution
- Discussion
- See Also
- Deploying with Capistrano When You Cant Access Subversion
- Problem
- Solution
- Discussion
- See Also
- Deploying with Capistrano and mongrel_cluster
- Problem
- Solution
- Discussion
- See Also
- Disabling Your Web Site During Maintenance
- Problem
- Solution
- Discussion
- See Also
- Writing Custom Capistrano Tasks
- Problem
- Solution
- Discussion
- See Also
- Cleaning Up Residual Session Records
- Problem
- Solution
- Discussion
- See Also
- 14. Extending Rails with Plug-ins
- Introduction
- Finding Third-Party Plug-ins
- Problem
- Solution
- Discussion
- See Also
- Installing Plug-ins
- Problem
- Solution
- Discussion
- See Also
- Manipulating Record Versions with acts_as_versioned
- Problem
- Solution
- Discussion
- See Also
- Building Authentication with acts_as_authenticated
- Problem
- Solution
- Discussion
- See Also
- Simplifying Folksonomy with the acts_as_taggable
- Problem
- Solution
- Discussion
- See Also
- Extending Active Record with acts_as
- Problem
- Solution
- Discussion
- See Also
- Adding View Helpers to Rails as Plug-ins
- Problem
- Solution
- Discussion
- See Also
- Uploading Files with file_column
- Problem
- Solution
- Discussion
- See Also
- Uploading Files with acts_as_attachment
- Problem
- Solution
- Discussion
- See Also
- Disabling Records Instead of Deleting Them with acts_as_paranoid
- Problem
- Solution
- Discussion
- See Also
- Adding More Elaborate Authentication Using the Login Engine
- Problem
- Solution
- Discussion
- See Also
- 15. Graphics
- Introduction
- Installing RMagick for Image Processing
- Problem
- Solution
- Windows
- Linux
- Mac OS X
- Discussion
- See Also
- Uploading Images to a Database
- Problem
- Solution
- Discussion
- See Also
- Serving Images Directly from a Database
- Problem
- Solution
- Discussion
- See Also
- Creating Resized Thumbnails with RMagick
- Problem
- Solution
- Discussion
- See Also
- Generating PDF Documents
- Problem
- Solution
- Discussion
- See Also
- Visually Displaying Data with Gruff
- Problem
- Solution
- Discussion
- See Also
- Creating Small, Informative Graphs with Sparklines
- Problem
- Solution
- Discussion
- See Also
- A. Migrating to Rails 1.2
- Action Controller
- Active Record
- Action View
- Index
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly