What is Ruby on Rails?
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.
TFA seems to be written by a used car salesman. Or maybe those guys on the infomercials late night for different "enhancement" drugs.
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.
Your eyes are full of hate. That's good. Hate keeps a man alive. It gives him strength.
Ruby has a heavy Smalltalk heritage, including the continuations. Just for fun, have a look at Borges , Seaside 2 ported to Ruby!
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.
"He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
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.
Pete
There are some interesting sites. Note Epson Developers. You might find this note about a large medical application interesting. I also noted a Rails project being developed in a department of the New York City government.
Bruce
Bruce Perens.
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
Don't let your Java get run out on a Rail just yet
My opinion hasn't changed much since.
*** Sigs are a stupid waste of bandwidth.
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.
:emails
:person
:people do |t| :first_name, :string :last_name, :string :date_of_birth, :datetime :biography, :text
:emails do |t| :person_id, :integer :address, :string
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.)
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.
fak3r.com
For those using Java and wishing for a RoR-like package for Java, look at Trails - https://trails.dev.java.net/
Simpy
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 with silly constraints?
Django leaders love PostgreSQL. I want to try Rails but I don't trust MySQL (or fans of it).
how about:
PURR: PostgreSQL, UNIX, Ruby and Rails
or RAPR: Rails on Apache, PostgreSQL, and Ruby
(kinda motorola type thing)
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.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.