Home arrow Ruby-on-Rails arrow Connecting Your Reports to the World

Connecting Your Reports to the World

Creating reports that can be viewed on the desktop is good; creating reports that can be viewed over the Internet is even better. This article will explain how to make reports written with Ruby-on-Rails accessible over the web. It is excerpted from chapter 5 of the book Practical Reporting with Ruby and Rails, written by David Berube (Apress; ISBN: 1590599330). This article is the first part of a two-part series.

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
March 25, 2010
  1. · Connecting Your Reports to the World
  2. · Live Intranet Web Reporting with Rails
  3. · Setting Up the Database
  4. · Adding the Data

print this article

Connecting Your Reports to the World
(Page 1 of 4 )

Reporting does not take place in a vacuum. Reports are written for a specific purpose for a given set of users. Technical choices like "what language do I use" and "how do I deliver the information" are heavily influenced by the users and by the purpose of the report. After all, your users must be able to access the report for it to be useful.

Perhaps the most powerful method to deliver reports to your user is via the World Wide Web. Users can access the information from virtually any Internet-connected device, and because of the Internet's ubiquity, you probably won't need to do any special configuration for their computers--just give users the web address, and they should be all set.

In this chapter, you'll learn how to make your reports accessible from the Web. Let's start with a quick look at your choices for accomplishing this.

Choosing a Web Framework

Many web frameworks and languages are available. Of course, since you bought this book, it's likely you're interested in Ruby web frameworks, and probably Ruby on Rails (typically referred to as simply Rails) in particular. In fact, Ruby itself has grown dramatically due to Rails' meteoric rise to prominence. (Incidentally, Active Record, which you've used in previous chapters, is part of Rails.)

However, you can use other Ruby web frameworks. Nitro (http://www.nitroproject.org/), for example, is a powerful alternative. Another is Merb (http://merb.rubyforge.org/), which is a framework similar to Rails, but with a much smaller footprint. Merb also lets you use alternate ORM frameworks, like Data Mapper, so its more flexible.

Due to Rails popularity and widespread community support, it's the framework you'll use for the web examples in this book. Rails, like Nitro and Merb, is a Model-View-Controller (MVC) framework. Following the MVC pattern, code is generally divided into three parts:

  1. The model represents the data used by the application. 
  2. The view represents the actual presentation of the data. 
  3. The controller controls the flow of the application. A controller often manipulates models to achieve an action requested by a user, and then presents the results with a view.

You can find out more about MVC frameworks at http://en.wikipedia.org/wiki/Model-view-controller. You can find out more about Rails at its official home: http://rubyonrails.org.

Now, let's take a look at how to create a Rails application to deliver a web report.

blog comments powered by Disqus

- Ruby-on-Rails Faces Second Security Flaw in ...
- Ruby 2.0 Prepped for February 2013 Release
- Why LinkedIn Switched from Ruby on Rails
- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials