Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

What is Ruby on Rails? 296

Robby Russell writes "ONLamp.com has published another article by Curt Hibbs titled, 'What is Ruby on Rails?.' In this article, Curt goes on to discuss all the major components of the popular Rails web framework and shows it does a lot of the heavy lifting for you. This article highlights all the major features, from Active Record to Web Services, which are going to be included in the upcoming 1.0 RC release of Ruby on Rails. With one book published already and four more on the way, do you think Rails will continue gaining as much popularity in the coming year?" An interesting follow-up to the two part tutorial from earlier this year.
This discussion has been archived. No new comments can be posted.

What is Ruby on Rails?

Comments Filter:
  • by WhoDey ( 629879 ) on Friday October 14, 2005 @10:21AM (#13790315) Homepage
    TFA seems to be written by a used car salesman. Or maybe those guys on the infomercials late night for different "enhancement" drugs.
  • by some_canadian_hacker ( 855993 ) on Friday October 14, 2005 @10:21AM (#13790317) Homepage

    It's good to see that a structured methodology is being introduced into the world of web development. I've seen some really shoddy implementations of *SQL APIs into a myriad of differing web platforms, and because this helps to tie together the actual implementation of database-driven web apps, the developers are freeer to work on other things... security issues? Maintaining database structure? Doing the groceries? It doesn't matter all that much when less time is spent making the framework for a web application.

    Looks promising.

  • Re:Seaside ? (Score:3, Interesting)

    by iggymanz ( 596061 ) on Friday October 14, 2005 @10:34AM (#13790403)
    Ruby has a heavy Smalltalk heritage, including the continuations. Just for fun, have a look at Borges [rubyforge.org], Seaside 2 ported to Ruby!
  • by Fished ( 574624 ) <(moc.liamg) (ta) (yrogihpma)> on Friday October 14, 2005 @10:36AM (#13790416)
    I've been using RoR, and I'm convinced that it is not just a flash in the pan. Let me preface this by saying that I've programmed in just about everything out there... from perl/mod_perl/cgi development, to php, to Zope, to Java, to Struts, etc. I have never seen a framework that makes it so easy to quickly develop well-architected applications as rails. A lot of the credit for this goes to two things. First, Rails features, out of the box, excellent use of automation to setup the structure of your app for you. I can have basic CRUD functionality for a table with literally one command ('script/generate scaffold TableName'). Second, Rails has a built-in ORM layer (ActiveRecord) that greatly simplifies everything, in particular because it is very good ORM.

    On one of the Rails pages they talk about a functional website in less times than other frameworks would have you spend on XML situps, and I have to agree. (Excursus: am I the only one who is underwhelmed with XML for application configuration? Apparently not!) Everything depends much less on configuration and much more on convention. This means less code to debug, which means more time to write the really distinctive stuff that was why you were custom-coding an app in the first place.

    Ruby is also a dream come true. The speed of perl, the OO features of python, but without perl's crufty syntax and python's rigidity. Where in the past Ruby was often poorly documented, and sometimes slow and buggy, it has largely overcome these limitations.

    Try rails. You'll like it.

  • by phurley ( 65499 ) on Friday October 14, 2005 @10:56AM (#13790566) Homepage
    I have also been using it -- and love it, but a quick note (not that I think it is that important generally speaking) -- ruby is not as fast as perl. It still uses an interpreted syntax tree, that is not as fast as perl's bytecode interpreter. YARV, should fix this, but it is still development level code.

    Of course having said that, the heavy lifting in ruby (like most scripting languages) is implemented in C, and I rarely have application performance issues with my ruby programs (including but not limited to rails). When there is a performance problem, ruby has very nice benchmarking/profiling tools and a good extension system for writing code in C/C++, so for me this is a non issue.

  • Re:Dear Slashdot (Score:1, Interesting)

    by mccormick ( 40772 ) on Friday October 14, 2005 @11:30AM (#13790867)
    Perl 6 never given a definitive delivery date, so surely it cannot be "late." Sure, they have been working on it for awhile now and adding all sort of strange magics to the brew (borrowing the best from Perl5/Python/Ruby, incorporating functional concepts from Haskell and others), but nobody said it was going to be finished soon. I guess they're going for longevity and that takes time to really work out. As the recent upsurge of interest in Ruby shows, despite having a whole range of other more common/popular languages and platforms, there's always room for something new when it is a genuine improvement. So I figure even if it takes awhile before it's ready for mass consumption, if Perl6 is solid then it will be worth the wait, and people will still start using it then even if they've settled into other languages in the meantime.

    As well, thanks to Pugs over the past year, development on Perl 6 is really starting to pick up, with the language developments having an implemention to work them out on, and the overall effort having more to show than simply Parrot and some very much so work in progress ports of other languages.
  • by Bruce Perens ( 3872 ) <bruce@perens.com> on Friday October 14, 2005 @11:32AM (#13790886) Homepage Journal
    I visit Fortune 100 companies in my work for Sourcelabs. The managers comment that their engineers are clamoring to use Rails and the managers are holding back until the product is more mature. They continue to watch the trend.

    There are some interesting sites. Note Epson Developers [epsondevelopers.com]. You might find this note [gmane.org] about a large medical application interesting. I also noted a Rails project being developed in a department of the New York City government.

    Bruce

  • by Bazman ( 4849 ) on Friday October 14, 2005 @11:46AM (#13791003) Journal
    I've just read that Four Days thing and one thing is glaringly missing. You get to write a TODO management application, but there's no security. Anyone can edit, add, change, delete the TODO items.

    So now you want to add security - for simplicity's sake lets suppose you just want you to be able to edit or change anything, and anyone else to be able to view the todo list. How do you add this sort of security framework into a Rails app? I've not seen this done anywhere. Can someone point me to docs that would do this?

    In Zope, you get security built into the basic objects, with permissions and roles, so what can be done by users is built into the framework.

    Baz
  • by bADlOGIN ( 133391 ) on Friday October 14, 2005 @12:03PM (#13791147) Homepage
    Don't let your Java get run out on a Rail just yet [slashdot.org]
    My opinion hasn't changed much since.
  • by Vacindak ( 669486 ) on Friday October 14, 2005 @12:14PM (#13791233)
    The truth is the Rails is well designed all the way through.  I've actually written quite a few things that munge around with the inner workings of Rails (Ruby makes this very easy with all of its metaprogramming constructs), and I've seen first-hand how the components were put together.

    The most important thing to realize is that Rails heavily embraces the concept of "domain-specific languages."  Because of the Ruby's blocks and the ability to dynamicly insert new methods and/or respond to method calls on methods that don't technically exist, it's very easy to effectively create new syntax tailored specifically to the task at hand.

    For example, if you want to have a one-to-many relationship between the people table and the emails table (people often have more than one email address), it would be as simple as this:

    class Person < ActiveRecord::Base
      has_many :emails
    end

    class Email < ActiveRecord::Base
      belongs_to :person
    end

    Or let's say you were writing some schema migration code, and you need to create the corresponding database tables for those two model classes:

    create_table :people do |t|
      t.column :first_name, :string
      t.column :last_name, :string
      t.column :date_of_birth, :datetime
      t.column :biography, :text
    end

    create_table :emails do |t|
      t.column :person_id, :integer
      t.column :address, :string
    end

    That code doesn't care whether you're using PostgreSQL, or MySQL, or Sqlite, or whatever.  And if you need to move into some vendor-specific SQL for some reason, it still doesn't get in your way, because you can just execute whatever raw SQL you need to run.

    Incidentally, the point of schema migration code is to allow you to easily switch between database schema versions while maintaining data integrity.  This is ideal for prefabricated software built using Rails like wikis, blog engines, cms's, etc, since they can change the database schema as required, and upgrading to the new version is as simple for the user as running "rake migrate".

    And that stuff is just the data access layer.  Rails has just as much nifty magic going on in the view and controllers.

    For a high level view of how the components fit together, just stop by the RoR website.  The relevant diagram is prominently featured on the front page.

    http://www.rubyonrails.com/

    (Why doesn't slashdot let me use <pre> block directly?  That's really wierd.)
  • Re:Watch the demo... (Score:4, Interesting)

    by fak3r ( 917687 ) on Friday October 14, 2005 @12:23PM (#13791305) Homepage
    Yep, mostly what I'm seeing (apache's http-access.log and typo/logs) are straight web-server access (mod_proxy on apache -> lighttpd) but plenty of 'live searches' (which is why I suggested it) when fcgi (dispatch.fcgi) takes over and chats with the database. Still, even those are coming back faster than I'd expected. Yes, I've had 1 minute refreshes of the front page, but I didn't expect it to be perfect, I've just never had this kinda sustained traffic to study, and am really impressed with how Typo/Lighttpd are working.

    It's just something when it's a box that you built by hand from newegg parts, then installed/tweaked freebsd on, and then setup a new blog just a few weeks back, to see it perform.
  • by partenon ( 749418 ) on Friday October 14, 2005 @12:36PM (#13791413) Homepage
    FYI, there's a Rails IDE out there: http://www.radrails.org/ [radrails.org] . Its a pretty new IDE (actually, plugins over eclipse) that promisses to kill your first point :-)
  • Trails: RoR for Java (Score:3, Interesting)

    by otisg ( 92803 ) on Friday October 14, 2005 @01:06PM (#13791688) Homepage Journal
    For those using Java and wishing for a RoR-like package for Java, look at Trails - https://trails.dev.java.net/ [java.net]
  • by Anonymous Coward on Friday October 14, 2005 @01:09PM (#13791717)
    That Rails programmer guy only suggests that Rails developers use MySQL. He seems to hate PostgreSQL, Oracle, and all databases that enforce CONSTRAINTS. How do we know that it works in PostgreSQL (properly) when the lead developer doesn't think you should even waste your time [loudthinking.com] with silly constraints?

    Django leaders love PostgreSQL. I want to try Rails but I don't trust MySQL (or fans of it).
  • by talonyx ( 125221 ) on Friday October 14, 2005 @03:13PM (#13792809)
    how about:

    PURR: PostgreSQL, UNIX, Ruby and Rails

    or RAPR: Rails on Apache, PostgreSQL, and Ruby
    (kinda motorola type thing)
  • by Phleg ( 523632 ) <<stephen> <at> <touset.org>> on Friday October 14, 2005 @04:46PM (#13793709)

    I feel like the real skill of development lies in making stuff like that, and if it becomes defacto, all you do is build applications from building blocks. I feel it takes away some of the 'art' of development. You'd say, oh I build a nice webshop, and the other person would sya, what did you use, and your answer wouldn't be php, mysql, some html/css and javascripting. It'd be Ruby on Rails, of Smarty Templates combined with some Data Access layer, or a whole lot of those java spring/hibernate thingies. And all you did was tie up the ends.

    Not at all; you have it all backwards. Rails ties up the loose ends for you, letting you actually do the artistic stuff that makes your program really go. You don't have to bother writing an ORM to your database, tying unit testing to your framework, creating your own templating code, etc., all the ends are tied together for you. It's up to you to write the contents.

  • by hey! ( 33014 ) on Friday October 14, 2005 @05:10PM (#13793911) Homepage Journal
    Well, speaking as a CTO, I'd be slightly offended by your implication that we're a bunch of dunderheaded idiots, except that being CTO means forgetting what the meaning of "shame" is. ;-)

    In any case, there fortunately isn't any reason to use PL/SQL. You can write stored procedures as static java methods in Oracle. Maybe not ideal, but still a lot easier than porting. There's a project for Postgres that allows stored procedure and trigger logic in Java too.

    In some cases web services may be a good for coarse grained kinds of services.
  • by jallen02 ( 124384 ) on Saturday October 15, 2005 @04:05PM (#13798691) Homepage Journal
    I am pretty big on Java. I have done several years worth of Java work. I decided to finally try Rails out so I could finally see if the hype was worth it or not. I was *quite* impressed. I realize there are about 10 million concerns that pop into my head. Legacy applications, complex ORM mapping, ona nd on. But for new software it truly is amazing. Its fast and easy and it just seems to work. I am not generally to excitable about new technology I have seen a lot. When I was finished playing with RoR for about 4 hours the amount of working software I had was impressive.

    It has to grow a lot. However, if you are implementing from the ground up it is a rather solid choice. The architecture and tools are quite good. You can get hung up on the semantics of things if you want to.. you just can't argue with the results. Fast and easy. When I started describing my initial experience I realized I sounded just like a sales person trying to convince people about the greatness of something. So I can actually understand. Years and years of doing Java work and configuring XML and working hard at throwing out skeleton code. Generating getters and setters and connecting together several layers of components to all play nicely together. I compare that to Rails and it makes me wish I had this power all along. I have not tried anything truly complicated in RoR yet, but I will. I don't think Ruby, or RoR will let me down in the long run. Its such a light weight framework that you can easily grow it to fit your needs.

    Jeremy

"I've got some amyls. We could either party later or, like, start his heart." -- "Cheech and Chong's Next Movie"

Working...