Book Image

Ruby on Rails Enterprise Application Development: Plan, Program, Extend

By : Elliot Smith, Rob Nichols
Book Image

Ruby on Rails Enterprise Application Development: Plan, Program, Extend

By: Elliot Smith, Rob Nichols

Overview of this book

<p><br />All businesses have processes that can be automated via computer applications, thereby reducing costs and simplifying everyday operations. This book demonstrates that a modern web application framework makes an ideal platform for such applications. It shows how the attributes that make the Rails framework so successful for Internet applications also provide great benefit within a business intranet. These attributes include easy roll-out and update of applications, centralized processing and data handling, simple maintenance, straightforward code development, and scalability.<br /><br />Ruby on Rails is an open-source web application framework ideally suited to building business applications, accelerating and simplifying the creation of database-driven websites. Often shortened to Rails or RoR, it provides a stack of tools to rapidly build web applications based on the Model-View-Controller design pattern.<br /><br />This book covers topics such as installing Ruby, Rubygems, and Rails on Windows, Linux, and Mac OS X; choosing and installing a database; installing an IDE for Rails development; setting up a Subversion repository to manage your code; creating a new Rails application; understanding Rails models; understanding controllers and views; improving user interfaces with Ajax; using Rails plugins to manage file uploads; using Capistrano to manage application deployment; techniques for scaling Rails applications, such as caching and using Apache to proxy through to the Mongrel server. The example application is straightforward to develop, easy to roll out, and simple to maintain.</p>
Table of Contents (16 chapters)
Ruby on Rails Enterprise Application Development
Credits
About the Authors
Preface
Index

Preface

Ruby on Rails is a development framework designed to make the creation of web applications straightforward, well structured, and productive. By using convention over configuration, it reduces the work needed to set up an application and leaves the developer to concentrate on the components that address the problem at hand. That is, the common repetitive basic tasks are dealt with seamlessly and easily, and therefore most effort can be concentrated on creating the particular elements required for the current solution.

The strengths of this framework, that make it such an excellent tool to create Internet applications, also make it an excellent system to create business applications within private networks. It allows a developer to efficiently create distributed applications. Thereby users throughout a company are able to enter, manipulate, and report on data. This is done in a way that is easy to roll out and maintain; the resulting applications are easy to expand and extend.

This book describes both how to create business applications using Ruby on Rails, and how to create the complete creative environment. This includes how to support the development process with systems such as version control and integrated development environments, and deploy the final product on efficient web and database servers.

What This Book Covers

Chapter 1 provides an overview of the book. You will learn why Ruby on Rails should be used in preference to the multitude of other programming and scripting frameworks for developing database-driven web applications.

Chapter 2 here you will learn about some of the conventions used in Rails, and the Rails framework will be introduced. We describe some methods of controlling and logging user access and discuss their merits and limitations. We also discuss data validation and user input control via form design in this chapter.

Chapter 3 outlines how to lay some firm foundations for a sustainable Rails development project. The core of this is obviously the Rails stack itself. You will learn how to install and configure this in some detail. The chapter recommends a few of the technologies closest to the heart of Rails, which can readily be used to support your development work.

Chapter 4 will help you build from an idea and an initial Rails installation to a fully-fledged data model, populated from an external data source, with full validation and unit test suite. This chapter also provides examples of how to integrate the application with external data sources, and how to share code development across a team.

Chapter 5 describes how to build a web interface on top of the models developed earlier. You will learn about creating a controller from scratch, how to add style sheets, writing complex controller actions to update multiple models simultaneously, and using pagination.

Chapter 6 describes how to set up a Rails production environment. In particular, it covers the decisions you will need to make to successfully get your business application up and running. Some coverage of error handling is presented, and we describe some systems that will make it easier to back up and restore your application.

Chapter 7 concentrates on the tools you can use to improve the user experience. These include providing links into the application, providing search tools, enhancements to the user interface, and providing help to the users.

Chapter 8 aims at showing more of the depth and usefulness of Rails, while at the same time demonstrating how to extend an existing application with new functionality.

Chapter 9 discusses advanced deployment of your application. You will learn how to deploy your application with Capistrano. You will also learn about troubleshooting deployment and optimizing your Rails applications.

Chapter 10 covers how you can improve your Rails skills further, and suggests alternative skills that complement Ruby on Rails, thereby broadening your skill set.

What You Need for This Book

You need prior knowledge of Ruby on Rails, as this book helps developers to find out how to rapidly build easily-deployed, easily-supported business applications.

Who is This Book for

Developers who have completed on-line Ruby on Rails tutorials and perhaps have built their first basic application are a key group this book is aimed at, especially those who like what they have seen in the basic tutorials, and now want to know how to create an environment in which they can most efficiently develop new applications and improve their understanding of the Rails framework.

This book is also aimed at developers who particularly want to create data-centric applications within a private network, those who want to leverage the best of intranet applications to provide distributed easily maintained applications.

On completion of the book the reader will not only know how to write better Ruby on Rails code, but also how to create a development environment and roll out completed applications onto production systems.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code will be set as follows:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

Any command-line input and output is written as follows:

# cp /usr/src/asterisk-addons/configs/cdr_mysql.conf.sample
     /etc/asterisk/cdr_mysql.conf

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".

Note

Important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to , making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.