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, e
Beginning Ruby on Rails
β Scribed by Steve Holzner Ph.D.
- Publisher
- Wiley/Wrox
- Year
- 2007
- Tongue
- English
- Leaves
- 403
- Series
- Wrox beginning guides / Programmer to programmer
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
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
Beginning Ruby on Rails......Page 1
About the Author......Page 8
Acknowledgments......Page 12
Contents......Page 14
How This Book Is Structured......Page 20
Conventions......Page 21
Source Code......Page 22
p2p.wrox.com......Page 23
Installing Ruby and Rails......Page 24
Creating a First Web Application......Page 26
Getting Started with Ruby......Page 30
Checking the Ruby Documentation......Page 32
Working with Numbers in Ruby......Page 33
Working with Strings in Ruby......Page 34
Storing Data in Variables......Page 36
Interpolating Variables in Double-Quoted Strings......Page 38
Reading Text on the Command Line......Page 39
Working with Operators......Page 41
Working with Arrays......Page 44
Using Two Array Indices......Page 47
Working with Hashes......Page 50
Working with Ranges......Page 52
Summary......Page 54
Exercises......Page 55
Itβs All about Making Choices: the if Statement......Page 56
Using the case Statement......Page 62
Using Loops......Page 64
Creating and Calling a Method......Page 74
Making Use of Scope......Page 80
Working with Blocks......Page 81
Summary......Page 84
Exercises......Page 85
All about Encapsulation......Page 86
Creating a Class......Page 87
Creating an Object......Page 89
Basing One Class on Another......Page 95
Understanding Rubyβs Object Access......Page 98
Overriding Methods......Page 102
Creating Class Variables......Page 103
Creating Class Methods......Page 105
Creating Modules......Page 106
Creating Mixins......Page 108
Exercises......Page 110
Putting Ruby on Rails......Page 112
Introducing Model-View-Controller Architecture......Page 123
Giving the View Something to Do......Page 125
Mixing Ruby Code and HTML Inside the View......Page 128
Passing Data from an Action to a View......Page 131
Escaping Sensitive Text......Page 134
Adding a Second Action......Page 136
Summary......Page 143
Exercises......Page 144
Accessing Data the User Provides......Page 146
Using Rails Shortcuts for HTML Controls......Page 160
Working with Models......Page 166
Tying Controls to Models......Page 168
Initializing Data in Controls......Page 174
Storing Data in Sessions......Page 176
Exercises......Page 180
Tutorial on Databases......Page 182
Creating the Database......Page 185
Running the store Application......Page 192
Adding Another Record......Page 203
Beautifying the Display......Page 210
Exercises......Page 212
Displaying Items to the Customer......Page 214
Creating a Shopping Cart......Page 220
Combining Purchases in the Cart......Page 236
Clearing the Cart......Page 239
Letting the User View the Cart Anytime......Page 242
Summary......Page 244
Exercises......Page 245
Validating the Presence of Data......Page 246
Validating if Data Is Numeric......Page 249
Validating if Data Is Unique......Page 252
Creating the Validator Application......Page 254
Writing Your Own Validate Method......Page 269
Testing Your Model......Page 271
Testing Your Controller......Page 279
Exercises......Page 282
Routing Refinements......Page 284
Creating Cookies......Page 289
Creating a Filter......Page 296
Logging in with Filters......Page 301
Using After Filters......Page 308
Rendering Text Directly......Page 313
Caching......Page 315
Summary......Page 316
Exercises......Page 317
Creating XML......Page 318
Creating XML Attributes......Page 323
Using View Helpers......Page 326
Using View Pagination......Page 332
Using Partial Templates......Page 338
Passing Data to Partial Templates......Page 340
Exercises......Page 343
Using Ajax......Page 344
Getting Access to Ajax Data......Page 348
Using XML and Ajax......Page 352
Using HTML Controls and Ajax......Page 357
Performing Ajax Searches......Page 361
Performing Visual Effects......Page 365
Summary......Page 367
Exercises......Page 368
Answers to Exercises......Page 370
SYMBOLS AND NUMERICS......Page 388
A......Page 389
C......Page 390
D......Page 391
E......Page 392
F......Page 393
J......Page 394
M......Page 395
O......Page 396
P......Page 397
R......Page 398
S......Page 399
T......Page 400
U......Page 401
W......Page 402
Y......Page 403
π SIMILAR VOLUMES
Overview: In the world of programming, many types of languages are being used. If you are just starting out, the first decision that you will have to make is which of these coding tools should you use. Learning how to code brings upon foreign concepts, technical jargon and many challenges. With that
Ruby on Rails is the hottest new open source technology around. It offers developers the opportunity to create fully-featured web applications in double-quick time. Rails and e-commerce are a match made in heaven and Beginning Ruby on Rails E-Commerce is the first book to directly target this market
<p><span>There is no shortage of programming languages and frameworks out there. But in the midst of all this, Ruby on Rails stands out. Despite losing out on the top spot to other contenders, Ruby on Rails has earned for itself a position of repute and a robust user base. </span></p><p><span>Ever s
Book is for people who want to learn how to build realworld professional web applications using Rails best practices. We put a specific emphasis on e-commerce by showing you how to build an online bookstore, including a shopping cart, catalog, forum, and other functionality. On the front-end, we gui
<p><p><i>Beginning Ruby on Rails E-Commerce: From Novice to Professional</i> is the first book of its kind to guide you through producing e-commerce applications with Rails, the stacked web framework taking the world by storm. The book dives right into the process of creating a production-level web