Rolling With Ruby On Rails 406
Bart Braem writes "The Ruby community is abuzz about Rails, a web application framework that makes database-backed apps dead simple. What's the fuss? Is it worth the hype? Curt Hibbs shows off Rails at ONLamp, building a simple application that even non-Rubyists can follow."
Played with it (Score:5, Informative)
Ruby has already inspired a few efforts to duplicate the technology in Java and in
The usual warnings apply. Implicit code is easier 90% of the time, but that other 10% is painful to debug. With large projects you can prototype fast, but maintaining may be much more difficult.
Useful Ruby Online Resources (categorized) (Score:5, Informative)
http://www.rubygarden.org/ruby?RubyOnTheNet [rubygarden.org]
Interactive ruby resources:
irc://irc.freenode.net/ruby-lang - the #ruby-lang channel is popular. More info at RubyOnIRC
http://www.ruby-forum.org/bb/ - a forum for ruby novices to ask questions
news://comp.lang.ruby - the ruby newsgroup
Ruby websites:
http://www.ruby-lang.org/ - ruby home
http://www.ruby-doc.org/ - ruby docs and online reference
http://www.rubyforge.org/ - rubyforge ruby projects
http://raa.ruby-lang.org/ - ruby application archive
Ruby Code Examples and Snippets:
http://pleac.sourceforge.net/pleac_ruby/ - ruby pleac
http://www.rubygarden.org/ruby?RubyOnlineCookbo
Popular ruby and ruby-related projects:
http://rubyinstaller.rubyforge.org/wiki/wiki.pl - ruby installer for Windows
http://rubyforge.org/projects/rubygems/ - rubygems ruby package manager
http://www.yaml.org/ - ruby 1.8 includes built-in yaml support
http://www.rubyonrails.com/ - web framework in ruby
http://rubyforge.org/projects/instiki/ - wiki in ruby
Re:Ruby still needs ISP support (Score:2, Informative)
Ready, installed, and waiting.
Re:Ruby still needs ISP support (Score:2, Informative)
http://www.modwest.com/ [modwest.com]
Re:Good for "recipe" queries but little else (Score:4, Informative)
You might want to tell that to Basecamp [basecamphq.com], 43 Things [43things.com], and Tada Lists [tadalist.com], since they obviously have no idea that Rails isn't good for anything of that magnitude. Might also mention it to all the thousands of people that use those sites, daily, and to the handful of developers who built and deployed those sites in a fraction of the time and cost of other web solutions.
Then again, maybe you shouldn't...
Rails is just the tip of the iceberg (Score:5, Informative)
Ruby is full of incredible libraries and frameworks like this, especially where text processing and web development are concerned. It's because Ruby has such a rich set of features.
Anyone who likes Rails should dig deeper. Heck, Ruby's standard library comes with some amazing things. Ruby also has a framework called RubyGems [rubyforge.org],
which is very much like Perl's CPAN integration or CommonLisp's ASDF framework.
Have you ever programmed a web app before? (Score:5, Informative)
It's extremely cool to watch someone set up a working webapp that fast.
But I have to take issue with:
Half of the darn article is setting up MySql and installing Ruby and Rails from scratch on a windows machine. Do you have any idea how much harder this crap is to write in other frameworks? You'd have to write at least 2x as much code. No one has an Active Record class as good as Rails'. You'd double the code count just doing the SQL linkage!It's one thing to be unimpressed, but it's another to know jack shit about the domain and say it's all worthless. Anyone who's ever made a web application will appreciate it.
Re:Ruby still needs ISP support (Score:3, Informative)
FAQ: Why isn't Ruby more popular than ...? (Score:1, Informative)
Before year 2000, there were no English-language books about Ruby. Now we have a fast-growing English library including Ruby in a Nutshell, Programming Ruby 2nd Ed., Teach Yourself Ruby in 21 Days, and more.
The lack of English documentation was what held Ruby back in popularity. With that problem now largely addressed, it has started to gain popularity rather quickly in the USA.
Ruby was designed by Yukihiro Matsumoto, a.k.a "Matz". It is a pure OO language but has time-saving features which make it useful for one-liners like Perl. If you like being highly productive, having fun programming, and want your code to make sense a year later, then give Ruby a try.
Re:Okay, so what else does it do? (Score:5, Informative)
http://ar.rubyonrails.org/
You can automatically retrieve data from the database in the form of an object, do manipulations or calculations, display it, modify it, then do a save() method on the object and it'll go right back into the database.
Re:Good for "recipe" queries but little else (Score:3, Informative)
Re:Nice framework... (Score:3, Informative)
Re:How does this compare to other stacks? (Score:4, Informative)
It's not so bad, Rails is unit tested very well (Score:5, Informative)
Secondly, the author knows that ActiveRecord could be a source of problems, which is why it's got dozens of unit tests, covering nearly every line of code.
Thirdly, even with all that bugs can and will sneak through, which is why ActiveRecord can, upon command, write a detailed log of its attempt to dynamically bind and create the classes you want. The logging is at the message-passing level of Ruby, which is nearly as atomic as you can get (you could hack the interpreter to go further, but that'd be pointless).
The dark ages of hideous bugs in dynamic code are gone my friend. We have the tools and techniques to make code of this type both safe and maintainable. Don't be afraid of it.
Re:Ruby still needs ISP support (Score:4, Informative)
Fantastic tech support, lots of support for opensource projects, a full ruby on rails implementation. These cats kick ass.
Lurk on the forums [textdrive.com] for a day or so to get a feel for things, it's not a bad place to call ~/
Real-life applications launched on the Rails (Score:2, Informative)
Basecamp [basecamphq.com] -- The original Rails application from which the framework was extracted. A hosted project management application that combines weblog, todo lists, milestones, file storage, and more to keep everyone on the same page in a project.
43 Things [43things.com] -- The "What do you want to do with your life?" application that lets you enter the 43 things that you're currently looking to achieve in life. You can blog about doing it, find others doing the same, and give advice to people who are doing things you've done.
Ta-da List [tadalist.com] -- The todo list component of Basecamp factored out into a free mini application. Uses XMLHttpRequest and other JS techniques to keep the interface super snappy. Sharable todo lists for every occasion.
And those are just a small sample of all the public applications out there on Rails. On top of that, there's a wide range of e-commerce, content management, business intelligence, intranet systems, and more being build inside a lot of organizations.
Exciting times!
Re:Ruby still needs ISP support (Score:3, Informative)
There's one host that looks promising: http://www.textdrive.com/ [textdrive.com] -- It's run by Dean Allen (wrote TextPattern), David Heinemeier Hansson (wrote Rails), Matt Mullenweg (wrote WordPress), among others.
Not astroturfing -- I co-lo elsewhere, and almost wish I was willing to do the virtual host thing again to try it out.
Re:Ruby still needs ISP support (Score:3, Informative)
Re:Played with it (Score:5, Informative)
Once you get used to the idea of passing blocks of code around, you'll love it, and won't be able to go back to Python... er... I mean, won't be able to go without it.
The canonical example is the iterator. Given an array pets containing ["dog", "cat", "fish"]:
Will return
dog
cat
fish
If you want to print out the uppercase versions
Or if you want to add some text:
Big deal, right? Not much different from a for loop. But blocks are amazing when dealing with things like a database. You can put all the setup, teardown and error-handling code in a method that's hidden from the user, and all they have to do is pass in the block they want the DB object to execute:
Unfortunately, slashdot eats my indentation, but fortunately, Ruby not being as picky about whitespace as *some languages*, that doesn't matter. Note that all that code is wrapped in a DBI.connect() call, which connects before it starts executing the block, and disconnects after. There's no "close" call required, it's all wrapped up for you.
Development time (Score:2, Informative)
I originally built Web Collaborator [webcollaborator.com] in 8,000 lines of PHP over a couple of months. In about 16 hours, I had completely rebuilt it from scratch in the Ruby on Rails framework with 1,000 lines of code.
I have since created sites like The Conjuring Cabaret [rufy.com] and S5 Presents [s5presents.com], both with astonishing simplicity and rapid development. Rails gives me short-cuts for almost everything I ever want to do with web development.
Nope. (Score:3, Informative)
Besides, Ruby doesn't have real continuations. Their continuations are based of longjmp() C call, so it has some limitations that real continuations don't have.
Re:Offtopic - Ruby (Score:3, Informative)
Check out www.rubycentral.org, which has an online ruby book (for 1.6, but it's a place to start). It will take you to all the other sites.
I highly recommend getting in on the mailing list, ruby-talk. It's very interesting.
weird directory structure (Score:5, Informative)
why can't someone build a decent framework that follows the simple "directories are directories and files are pages" model used by asp, php, cgi, etc.
and what's with the database naming conventions? the author kind of brushes it off at the end with this statement: "Even if you have to use a legacy database that does not use the Rails naming conventions, you don't have to give up the productivity advantages of using Rails--there is still a way to tell Rails explicitly what table and column names to use." personally I would not use those conventions no matter what database i was using, nor would any decent database developer or administrator i have ever known.
at any rate, at work i program in whatever language they tell me- currently asp+jscript, before that php. for personal projects, my current favorite is perl's HTML::Mason. all the benefits of php (and then some) without the awful language conventions.
Re:Offtopic - Ruby (Score:2, Informative)
Re:There's that bloody MVC again (Score:3, Informative)
The controller is responsible for manipulating the objects from the model.
The view is used to display controller data and to send user data back to the controller.
It works very well.
Re:Offtopic - Ruby (Score:1, Informative)
There's more than these, of course, but these will definitely get you started.
Re:weird directory structure (Score:2, Informative)
This also offers some nice possibilities for caching: save the result from the dynamic "/forum/list" request to a file called "/forum/list" in the "public" directory, and the web server won't bother Rails with this request at all, but will deliver the file directly. If the list content is expired, delete and recreate the file. Rails also provides methods to automate this.
I suggest you just try the tutorial; I'm sure you will find that Rails is extremely flexible and doesn't set any limits to your development style.
Re:Have you ever programmed a web app before? (Score:2, Informative)
That's just not true. Class::DBI lets you set up your application just as easily as Active Record. Try looking at some Maypole application examples to get a clue.