Sameer Siruguri

My Blog

So You Want To Make A Website In Rails

I’ve been getting a lot of requests lately asking about how much Ruby on Rails someone needs to know, to start coding a prototype. These come from folks with a variety of skills and levels of comfort with programming, mostly with a smattering of front-end (HTML, CSS, some Javascript) exposure, or perhaps some experience in having done some coding in college or for a job many years previously. This article is an attempt to put together a list of pointers that I have been developing over the last few months to help respond to these requests.

The first thing to understand is that Ruby on Rails is a framework that uses the Ruby language. There are other frameworks, most notably the frameworks CakePHP and Zend that use the PHP programming language, and Django that uses Python. The framework you choose should primarily be a matter of the language you are comfortable with, or that you’d like to learn. However, there are some significant benefits to using Ruby on Rails, especially as a beginner:

  1. More abstractions from the database, vs CakePHP and Zend: Ruby on Rails makes it easier to avoid needing to know how the database itself is created. Ruby on Rails code will do it for you – and by default, Rails uses SQLite as a database.
  2. More free, vs Zend: To get into serious Zend development, you’ll need to buy the developer studio and pay for the server. Rails (and Django) are entirely free.
  3. More helper commands: The Rails framework comes with a host of helper commands that automate many of the tasks you have to do “by hand,” in both the PHP and Python frameworks mentioned above. Django is much better than the PHP frameworks in this regard, but Rails goes a step further with its “magic” – commands that tie various pieces of your application together in one step.

For some time, two disadvantages of the Rails framework were the difficulty of installation and the learning curve in setting up simple applications. With versions 3 and 4 of the framework, installation has gotten a lot simpler – you can use Rails Installer on both Windows and Mac OSX environments for a fairly simple process of getting all the necessary pieces set up.

Frameworks – What Are They Good For?

Well, let’s take a step back – why do you need a framework at all? When you write a web application, there are many things to think about:

  1. Security: Your application should not be easily hacked – you shouldn’t have to worry about re-inventing all the wheels necessary to prevent your site from being hacked before it’s even up.
  2. Performance: It isn’t easy to get your site to run quickly, but a framework can help point you in the right direction.
  3. Managing Your Data: Any web application hasĀ to handle some data – whether it’s a search index, a stream of friend updates, or a catalog of books, it all comes down to data, and a framework will make it easier to organize the data and pass it back to the browser.

Model-View-Controller

 

 

Single Post Navigation

Leave a Reply

Your email address will not be published. Required fields are marked *