Beginning Ruby on Rails

Steve Holzner

  • 出版商: Wrox Press
  • 出版日期: 2006-11-29
  • 售價: $1,550
  • 貴賓價: 9.5$1,473
  • 語言: 英文
  • 頁數: 408
  • 裝訂: Paperback
  • ISBN: 0470069155
  • ISBN-13: 9780470069158
  • 相關分類: Ruby
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Description

Ruby on Rails is the revolutionary online programming tool that makes creating functional e-commerce web sites faster and easier than ever. With the intuitive, straightforward nature of Ruby and the development platform provided by Rails, you can put together full-fledged web applications quickly, even if you're new to web programming.

You will find a thorough introduction to both Ruby and Rails in this book. You'll get the easy instructions for acquiring and installing both; understand the nature of conditionals, loops, methods, and blocks; and become familiar with Ruby's classes and objects. You'll learn to build Rails applications, connect to databases, perform necessary testing, and put the whole thing together to create real-world applications such as shopping carts and online catalogs—apps you can actually use right away.

What you will learn from this book

  • How to install and use Ruby and Rails
  • Object-oriented programming with Ruby
  • Rails fundamentals and how to create basic online applications
  • How to work with HTML controls, use models in Rails applications, and work with sessions
  • Details on working with databases and creating, editing, and deleting database records
  • Methods for handling cookies and filters and for caching pages
  • How to connect Rails with Ajax

Who this book is for

This book is for anyone who wants to develop online applications using Ruby and Rails. A basic understanding of programming is helpful; some knowledge of HTML is necessary.

Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.

 

Table of Contents

Acknowledgments.

Introduction.

Chapter 1: Welcome to Ruby.

Creating a First Web Application.

Getting Started with Ruby.

Checking the Ruby Documentation.

Working with Numbers in Ruby.

Working with Strings in Ruby.

Storing Data in Variables.

Creating Constants.

Interpolating Variables in Double-Quoted Strings.

Reading Text on the Command Line.

Creating Symbols in Ruby.

Working with Operators.

Handling Operator Precedence.

Working with Arrays.

Using Two Array Indices.

Working with Hashes.

Working with Ranges.

Chapter 2: Conditionals, Loops, Methods, and Blocks.

It’s All about Making Choices: the if Statement.

Using the case Statement.

Using Loops.

Creating and Calling a Method.

Making Use of Scope.

Working with Blocks.

Chapter 3: Classes and Objects.

All about Encapsulation.

Creating a Class.

Creating an Object.

Basing One Class on Another.

Understanding Ruby’s Object Access.

Overriding Methods.

Creating Class Variables.

Creating Class Methods.

Creating Modules.

Creating Mixins.

Chapter 4: Welcome to Rails.

Putting Ruby on Rails.

Introducing Model-View-Controller Architecture.

Giving the View Something to Do.

Mixing Ruby Code and HTML Inside the View.

Passing Data from an Action to a View.

Escaping Sensitive Text.

Adding a Second Action.

Chapter 5: Building Simple Rails Applications.

Accessing Data the User Provides.

Using Rails Shortcuts for HTML Controls.

Working with Models.

Tying Controls to Models.

Initializing Data in Controls.

Storing Data in Sessions.

Chapter 6: Connecting to Databases.

Tutorial on Databases.

Creating a Data-Aware Rails Application.

Creating the Database.

Running the store Application.

Adding Another Record.

Beautifying the Display.

Chapter 7: Working with Databases.

Displaying Items to the Customer.

Creating a Shopping Cart.

Combining Purchases in the Cart.

Clearing the Cart.

Letting the User View the Cart Anytime.

Chapter 8: Validating and Testing.

Validating the Presence of Data.

Validating if Data Is Numeric.

Validating if Data Is Unique.

Creating the Validator Application.

Writing Your Own Validate Method.

Testing Your Model.

Testing Your Controller.

Chapter 9: Controlling the Action with the Action Controller.

Routing Refinements.

Creating Cookies.

Creating a Filter.

Logging in with Filters.

Using After Filters.

Rendering Text Directly.

Caching.

Chapter 10: Getting the Big Picture with Views.

Creating XML.

Creating XML Attributes.

Using View Helpers.

Using View Pagination.

Using Partial Templates.

Passing Data to Partial Templates.

Chapter 11: Ajax and Rails.

Using Ajax.

Getting Access to Ajax Data.

Using XML and Ajax.

Using HTML Controls and Ajax.

Performing Ajax Searches.

Performing Visual Effects.

Appendix A: Answers to Exercises.

Index.

商品描述(中文翻譯)

描述
Ruby on Rails是一個革命性的線上程式設計工具,使創建功能性電子商務網站比以往更快速和容易。憑藉Ruby的直觀和簡單性以及Rails提供的開發平台,即使您是網頁程式設計的新手,也可以快速建立完整的網頁應用程式。本書將為您提供對Ruby和Rails的全面介紹。您將獲得獲取和安裝Ruby和Rails的簡單指示;了解條件、循環、方法和區塊的性質;並熟悉Ruby的類和對象。您將學習構建Rails應用程式、連接數據庫、執行必要的測試,並將所有內容組合起來創建實際應用程式,例如購物車和線上目錄-您可以立即使用的應用程式。

本書的學習重點:
- 如何安裝和使用Ruby和Rails
- Ruby的面向對象編程
- Rails的基礎知識以及如何創建基本的線上應用程式
- 如何使用HTML控件,在Rails應用程式中使用模型,以及處理會話
- 詳細介紹如何使用數據庫,創建、編輯和刪除數據庫記錄
- 處理Cookie和過濾器以及緩存頁面的方法
- 如何將Rails與Ajax連接

本書適合對使用Ruby和Rails開發線上應用程式有興趣的任何人。具備基本的程式設計理解會有所幫助;需要一些HTML知識。

Wrox Beginning系列的書籍旨在使學習程式語言和技術變得比您想像的更容易,提供結構化的教程格式,引導您掌握所有相關技術。

目錄:
- 致謝
- 簡介
- 第1章:歡迎來到Ruby
- 創建第一個網頁應用程式
- 開始使用Ruby
- 檢查Ruby文檔
- 在Ruby中處理數字
- 在Ruby中處理字符串
- 在變量中存儲數據
- 創建常量
- 在雙引號字符串中插入變量
- 在命令行上讀取文本
- 在Ruby中創建符號
- 使用運算符
- 處理運算符優先順序
- 使用數組
- 使用兩個數組索引
- 使用哈希表
- 使用範圍
- 第2章:條件、循環、方法和區塊
- 一切都關乎做出選擇:if ```