Archive for the ‘Ruby on Rails Development’ Category

Four Ways Ruby on Rails Can Help You

Thursday, March 10th, 2011

In this article, we discuss some of the ways Ruby on Rails can help you in rapidly building fully-featured web-based applications.

1. Rapid Development and Prototypes

Issues caused by old techniques

When developing a website for a client, I want to concentrate on the clients needs i.e. the domain problem at hand. I don’t want to start thinking about setting up mountains of configuration files. Having to deal with such annoyances just delays what you are actually trying to achieve i.e. create a website which is specific to your clients domain. With conventional web development techniques, this issue can slow down the development process.

How Rails can help

Ruby on Rails uses a concept called Convention over Configuration which makes you follow conventions while you’re coding, leaving you with little configuration to do. For instance, if you created a model class called “Post” the corresponding database table will be called “posts” and the controller class will be called “PostsController”.
Further to this, Rails has a nice feature called scaffolding. Scaffolding allows you to create useful prototypes for clients in super fast times. However, a word of warning, it is deemed bad practice to use scaffolding code for actually building the final draft of a web application.

2. Structured Code and Neat Markup

Issues caused by old techniques

The main problem here, is separating the view markup from the business logic. A lot of old ASP and PHP web application have the business logic code scattered throughout the HTML. This makes life very difficult for, not only the programmer maintaining the code but the designer who is trying to find the markup. Needless to say, things were very unstructured in the web development days of yore.

How Rails can Help

As with many web frameworks, Rails uses the MVC compound design pattern to solve this problem. MVC (model-view-controller) splits the business logic into a “Model” layer and the view logic into a “View” layer. The “Controller” interacts with the Model and passes the required data onto the View. A full HTTP request cycle can be simplified into the following steps:

  1. The user sends a HTTP request by typing the required URL into the browser. This request is routed to a specific method in the controller.
  2. The method, being executed on the controller, interacts with the required model, which will usually retrieve some data from the database.
  3. The controller then passes control to the view, which specifies which HTML elements should be rendered and makes use of any data passed from the controller.
  4. The prepared HTML response is then passed back to the users browser.

So, what does MVC do for you? You will have clean, structured code, which is easily maintainable and very flexible. Enough said.

3. Interchangeable Databases

Issues caused by old techniques

I’m sure plenty of you have been there; Just created a lovely new, fully working, website using MySQL as the DBMS then, out of the blue, the client says "Oh Yeah, we don’t use MySQL, we use…". What do you do? Panic about all those embedded SQL query strings scattered throughout your code?

How Rails can Help

With Ruby on Rails this is not a problem, why? Well, Rails is database independent, meaning you can simply make a few configuration changes and hey presto, you’re now using Microsoft SQL or Oracle or SQLite (I could go on).

Further to this, Rails implements a design pattern called ActiveRecord to achieve Object Relational mapping (ORM). What the hell does that mean!?, I hear you say. This basically means that classes in your code can map directly to tables in your database. You can even define relationships between those objects in your classes.

ORM makes it simple to query the database without using database dependent SQL query strings, contributing to database agnosticism.

4. Database Schema Control

Issues caused by old Techniques

When working in a team of more than five, it can become hard to keep track of what changes are being made to the database. For example, someone could make a change to the database, removing a field from a table. Meanwhile, you could be writing code which expects that field to exist, simply because you are using an old revision of the database schema.

How Rails can Help

Rails solves this problem with Migrations. Migrations are called "Migrations" because they migrate the database from one state to another as a new modification is made. When changes are made, your fellow developers can run a simple command and they will be on the latest version of the database. Migrations are basically version control for your database schema.

Summary

To summarize, Rails does have a lot of new concepts to learn. However, this upfront learning curve will start to pay off when you see how much the framework gives you back in return.

Source:http://sixrevisions.com/web-development/four-ways-ruby-on-rails-can-help-you/

Did you like this? Share it:

Salesforce picks up Ruby on Rails web-app provider Heroku for $212M

Thursday, December 9th, 2010

 

Source: http://is.gd/iqq0T

Salesforce announced today that it has acquired Heroku, which develops and deploys web-based applications that rely on the programming language Ruby on Rails, for $212 million as part of its Cloud 2 suite of cloud applications. The company made the announcement at the Dreamforce 2010 conference in San Francisco.

Heroku helps developers streamline their Ruby on Rails web-based applications. Once a developer builds their app, they can launch it on Heroku, which then adjusts things like computing capacity and storage as needed. The community has more than 1 million developers and around 105,000 applications. Last fall, it started integrating with other services. For example, a company could launch their application on Heroku and then monitor it using services from another Rails startup, New Relic.

The company also recently raised a round of funding worth $10 million in May and has raised $15 million total after it was incubated by Y Combinator. The round was led by Ignition Partners, with participation from existing investors Redpoint Ventures, Baseline Ventures, and Harrison Metal Capital.

It’s a pretty sizable exit for a company that was founded in 2007, and another testament to how important cloud computing has become for a public company like Salesforce to pay out more than $200 million. It’s also another indication of a shift in Salesforce’s strategy to focus more on developers, as Heroku specializes in removing headaches for developers working with Ruby on Rails. Salesforce already works with VMforce, which similarly helps Java developers run their applications natively on Salesforce’s cloud application environment Force.com.

Did you like this? Share it:

RubyMine 3, the right choice for developing with Rails 3

Wednesday, December 1st, 2010

 

Source: http://bit.ly/f5SUNP

It is here! Please welcome everyone RubyMine 3.0 — the IDE created for Rails 3 development.

This release mainly focuses on strong Rails 3.0 compatibility but even if you are not on Rails 3 yet, you’ll find a huge number of improvements to every environment aspect, such as:

    * Ruby code coverage with RCov,
    * Support for LESS, SCSS, rdoc and improvements for all supported languages,
    * Zen coding support for faster HTML/CSS coding,
    * Much better Git integration and support for Mercurial version control,
    * Major UI changes and performance improvements.

Read more about what’s new and download RubyMine 3.0.

Other important change — RubyMine 3.0 personal license is now 30% cheaper than before!
Note that RubyMine 3 is a free upgrade if you have a RubyMine license purchased after Nov 29, 2009.

RubyMine 3.0 took time to appear but we are very happy with the result and want to heartily thank all the early adopters for their invaluable feedback.

Did you like this? Share it:

Serious Vulnerability Fixed in Ruby On Rails

Thursday, November 11th, 2010

By Lucian Constantin

The Ruby on Rails development team has released security updates for the web application framework, which address a serious vulnerability facilitating unauthorized record manipulation.

The issue stems from the way nested attributes were handled in the latest Ruby on Rails versions, 3.0.0 and 2.3.9.

An attacker could manipulate form parameters and make changes to records other than those the developer intended,” the official advisory explains.

The vulnerability is identified as CVE-2010-3933 in the Common Vulnerabilities and Exposures (CVE) database.

Older versions of the framework are not affected because the bug was accidentaly introduced in version 2.3.9.

It’s also present in the first stable release from the 3.0.x series, 3.0.0, which was launched at the end of August.

Web applications that don’t make use of the accepts_nested_attributes_for class method are not impacted by this vulnerability.

Users running any of the affected releases are strongly advised to upgrade immediately to the updated 3.0.1 or 2.3.10 versions.

The 2.3.10 is a normal release for the 2.3 branch, which contains multiple modifications. However, for reasons of urgency, 3.0.1 only contains a fix for this vulnerability.

A more comprehensive 3.0.2 update is expected to land in the near future and will address other bugs as well.

For users who can’t upgrade immediately, the development team has prepared patches, that can be applied manually.

Please note that only the 2.3.x and 3.0.x series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible,” the developers write.

Users also reported a version mismatch error when trying to upgrade 2.3.9 installations, that also had the Rails_XSS plugin. The issue has since been fixed, but updating the plugin is also required.

Matti Paksula and Juha Suuraho of a Rails-focused Web development company called Enemy & Sons are credited with reporting the vulnerability and helping testing the patch.

Ruby on Rails is the most popular open source web application development framework for the Ruby programming language.

Did you like this? Share it:

iPhone Web Development with Ruby on Rails

Friday, October 29th, 2010

 

by Chris Haseman, Adam Schwem

Leverage the tremendous buzz surrounding the iPhone by customizing your web site with CSS and Ruby on Rails.

Apple’s iPhone has taken the nation by storm. An alleged half million moved from the shelves into people’s pockets in the first weekend it went on sale. Safari, the iPhone’s native browser, claims to bring full featured browsing to the mobile device. You’ll learn, over the course of this article, more than a few tricks that will help your website stand out on the iPhone. Knowledge of Ruby is not required to learn from this article as it relies heavily on Cascading Style Sheets and JavaScript to work its magic. You should be able to apply the tricks you’ll learn here anywhere you’d use JavaScript or CSS. This article will not teach you everything you need to know about web development with Ruby on Rails, it will simply point out where the iPhone’s browser differs from an ordinary one. Add up all these custom tweaks and you should have the tools you need to take your web site mobile.

For a primer on Ruby on Rails, take a look at the Related Resources connected to this article.

Recognizing the iPhone

There are several different ways to detect if one of your visitors is hitting your page from an iPhone. Most of them rely on temporary "hacks" for assuming that safari is the only browser that will correctly accept "max-device-width" parameters. Since Ruby is all about simplicity, you should strive for a solution that is low in maintainability. Here’s the simple Ruby way of detecting the existence of the iPhone:

Read More

Did you like this? Share it: