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.
Strange Vibe from the Article (Score:4, Interesting)
Finally, a breath of fresh air (Score:4, Interesting)
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)
I've been using it... (Score:5, Interesting)
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.
Re:I've been using it... (Score:5, Interesting)
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)
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.
Heavyweights taking on Rails (Score:4, Interesting)
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
Re:More than just Scaffold (Score:3, Interesting)
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
Already covered this compared to Java... (Score:5, Interesting)
My opinion hasn't changed much since.
Re:Not so sure about this - I stil "don't get it" (Score:2, Interesting)
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
end
class Email < ActiveRecord::Base
belongs_to
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
t.column
t.column
t.column
t.column
end
create_table
t.column
t.column
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)
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.
Re:Already covered this compared to Java... (Score:2, Interesting)
Trails: RoR for Java (Score:3, Interesting)
Ruby on Rails only works on MySQL (Score:1, Interesting)
Django leaders love PostgreSQL. I want to try Rails but I don't trust MySQL (or fans of it).
Re:Rails and legacy databases (Score:4, Interesting)
PURR: PostgreSQL, UNIX, Ruby and Rails
or RAPR: Rails on Apache, PostgreSQL, and Ruby
(kinda motorola type thing)
Re:Finally, a breath of fresh air (Score:3, Interesting)
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.
Re:The ultimate contrarian answer to this question (Score:3, Interesting)
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.
Re:Strange Vibe from the Article (Score:3, Interesting)
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