Rails for PHP Developers / Edition 1
  • Rails for PHP Developers / Edition 1
  • Rails for PHP Developers / Edition 1

Rails for PHP Developers / Edition 1

by Derek DeVries, Mike Naberezny
     
 

A guide to learning both Ruby and Rails from a PHP developers perspective, this book also includes two extensive reference chapters that map the most common PHP tasks to their equivalents in the Ruby and Rails world.See more details below

Overview

A guide to learning both Ruby and Rails from a PHP developers perspective, this book also includes two extensive reference chapters that map the most common PHP tasks to their equivalents in the Ruby and Rails world.

Product Details

ISBN-13:
9781934356043
Publisher:
Pragmatic Programmers, LLC, The
Publication date:
02/01/2008
Series:
Pragmatic Programmers Series
Edition description:
New Edition
Pages:
430
Product dimensions:
7.58(w) x 8.92(h) x 0.79(d)

Table of Contents

Acknowledgments     xiii
Preface     xv
What Rails Offers     xv
Who Should Read This Book     xvi
Resources     xvi
PHP and Rails: A Personal View     xvii
About the Code Examples     xviii
About the Environment Used     xviii
Version Requirements     xix
How to Read This Book     xix
From PHP to Rails     1
Getting Started with Rails     3
Rails as an Extension of Ruby     3
The Components of Rails     4
Opinionated Software     5
The MVC Pattern and Rails     7
Installing Ruby and Rails     9
Creating a Rails App     10
Chapter Review     27
Exercises     27
Beginning Ruby Code     29
Seeing Ruby as a General-Purpose Language     29
Interacting with Ruby     31
Objectifying Everything     33
Accepting Ruby's Object World     34
Assigning to Variables     36
Writing Methods and Passing Parameters     39
Controlling Program Flow     43
Handling Errors     45
Understanding Blocks     51
Chapter Review     56
Exercises     57
Embracing the Ruby Philosophy     59
Thinking in Objects     59
Understanding Attributes     62
Method Visibility     64
Understanding Typing     66
Implementing Interfaces with Mixins     71
Organizing Code with Namespaces     75
Overriding Operators     78
Reopening Classes     80
Chapter Review     82
Exercises     82
Building a Rails Application     83
Modeling the Domain     85
Defining Requirements     86
Using the Database     89
Creating the Application     92
Generating the First Model     94
Building Database Tables     96
Employing ActiveRecord     101
Chapter Review     106
Exercises     107
Working with Controllers and Views     109
Identifying Resources     109
Creating Controllers     111
Routing Requests     114
Retrieving Meeting Data     118
Viewing Meetings     120
Adding Links     121
Creating New Meetings     127
Redirection and Flash Data     132
Administrating Meetings     134
Separating Public Files     142
Adding a Layout     144
Chapter Review     147
Exercises     149
Validating and Testing Models     151
Validating Model Data     151
Using Rails Environments     154
Testing Our Models     155
Chapter Review     161
Exercises     162
Authenticating Users     163
Migrating to a More Secure User     163
User Registration     165
Viewing and Editing Users     176
Restoring Sessions     182
Logging In     185
Chapter Review     190
Exercises     190
Defining Associations     193
Connecting Presentations     193
Testing Associations     196
Integrating Presentations into Meetings     198
Routing Presentations     199
The Presentation Controller     201
Spring Cleaning     206
Chapter Review     212
Exercises     213
Preparing to Launch      215
Adding the Home Page     215
Securing Our Actions     218
Protecting from Mass Assignment     224
Caching the Pages     226
Chapter Review     232
Exercises     232
Deploying the Application     235
Choosing a Host     236
The Production Environment     238
Preparing Our Application     239
Preparing Our Deployment Server     241
Launching the Application     246
Enhancing Performance     249
Scaling Your Application     253
Chapter Review     254
Exercises     255
PHP to Ruby at a Glance     257
PHP to Ruby Basics Reference     259
Basic Syntax     259
Basic Data Types     261
Variables     279
Constants     287
Expressions     289
Operators     291
Control Structures     300
PHP to Ruby Advanced Reference     311
Blocks     311
Functions     313
Classes and Objects     321
Exceptions     349
References     350
External Libraries and Packages     352
Documenting Code     354
PHP to Rails Reference     367
Templates     367
{dollar}_GET/{dollar}_POST     368
{dollar}_FILES     369
{dollar}_SERVER     372
Cookies     372
Sessions     374
Headers and Redirection     376
Security     377
Debugging     382
Accessing the Database     384
Email     386
Testing Rails Code     387
Rails Plug-Ins     392
Bibliography     395
Index     397

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >