Ruby on Rails 1.0 Released 332
Simon (S2) writes "Ruby on Rails 1.0 has been released. From the announcement: 'Rails 1.0 is mostly about making all the work we've been doing solid. So it's not packed with new features over 0.14.x, but has spit, polish, and long nights applied to iron out kinks and ensure that it
works mostly right, most of the time, for most of the people.' " The Ruby on Rails website has also been given a new look.
Re:Commercial equivalent is...? (Score:5, Informative)
Re:Er (Score:5, Informative)
Watch this video (Score:5, Informative)
Re:Er (Score:3, Informative)
Excuse me for sounding dumb, but what is Ruby on Rails? I've heard a lot about it recently, but haven't the slightest clue what it is. A little bit of background would be most appreciated.
Ruby on Rails is a web development framework. It provides a library for Ruby so it can be used with web development allowing it to be used in applications normally reserved for other languages.
Slashdot's big on this kind of stuff today. First the Java/everything else flamewar and now this (admittedly no flamewar.)
Re:"mostly right"??? (Score:4, Informative)
Re:Er (Score:2, Informative)
Re:Commercial/Enterprise use? (Score:5, Informative)
http://www.rubyonrails.org/applications [rubyonrails.org]
Re:Ruby on Rails more "secure" than PHP? (Score:4, Informative)
However, many of the problems associated with PHP are just due to flaws in the design of PHP. It's more a case of PHP being worse than it should be, rather than Ruby on Rails being extremely secure.
That said, most Ruby on Rails-related code is written by far more experienced developers. As would be expected, the quality of the code is higher, and the likelyhood of security issues is vastly reduced. The trend in the Ruby community to heavily use unit testing also helps ensure that quality is a paramount consideration.
Re:Commercial equivalent is...? (Score:4, Informative)
Coldfusion is a language of itself [albeit a simple one] that runs on top of a J2EE engine called Jrun...
Perl people, check out Catalyst (Score:5, Informative)
http://catalyst.perl.org/ [perl.org]
It's very nice so far, especially the controller portion. There's lots of addons and plugins for it, all of which are entirely optional. It's actually very open-ended and easy to extend.
I use the controller classes extensively, but write my own model, view, and support classes. Catalyst culture seems to encourage Class::DBI parentage as a base model class, but it's simple to roll your own (I hate CDBI, so I based mine on Ima::DBI instead). Your classes can work independently of Catalyst... it imposes no restrictions or inheritance constraints on you. Worth checking out.
Give ruby a quick try first (Score:5, Informative)
Also a great example of Ajaxy goodness, not to buzzword it too much. It's written by the affluent and creative why. Check out his neat-o blog too: http://redhanded.hobix.com/ [hobix.com]
-mix
Re:Web 2.0, Baby! (Score:2, Informative)
(I actually like the old design more
-mix
A rather large problem (Score:3, Informative)
As a developer RoR is a godsend, and compared with PHP development is incredible. But developer hapiness doesn't drive user adoption. Unless some things majorly change, I can't really see RoR catch on as a consumer technology, rather like the situation with J2EE today. But I can see it usurping the place of technologies like J2EE and
Re:Commercial equivalent is...? (Score:3, Informative)
mod_ruby is apparently a very limited way of embedding ruby code inside a web page, a la mod_php and the PHP language. Ruby on Rails works through the use of a CGI (or, preferably, a fast_cgi) script called the Dispatcher, which is (unsurprisingly) written in Ruby. The dispatcher handles the translation of requests and URIs to the code you've written using Ruby and the Rails framework.
It would be more accurate to say that Ruby is to Rails as PHP/Coldfusion is to Fusebox.
Re:When? (Score:4, Informative)
If you have to use Java, a copy-cat framework for Java is Trails [java.net]. The linked articles make it look pretty impressive.
Another relatively unknown java framework I've flirted with very recently is Stripes [mc4j.org]. It's claim to fame is that its configuration is annotation based. Dev consists of the view and action, no worrying about an xml file to sync between the two.
Re:Mod_python has easier syntax (Score:5, Informative)
Where did you get this impression? Maybe because you saw some regular expressions in Ruby? Ruby syntax is much, much clearer than Perl.
Take a look here [rubyist.net]
My Fucking God (Score:1, Informative)
Re:Commercial/Enterprise use? (Score:3, Informative)
I personally don't, but BaseCamp is written with RoR.. it's pretty high volume commercial site.
Penny Arcade is now on RoR.
Re:Why rails annoys me... (Score:2, Informative)
You mean the scaffolding functionality? That's a very very small part of Ruby on Rails and It's one of the most useless ones. Most of the knowledgeable Rails programmers don't use scaffolding at all. It's great for a quick CRUD prototype, but that's about it.
That's the *only* code generation going on in rails.
That is one sexy video. (Score:5, Informative)
About 5 years ago, if you wanted to make a blog, you'd sit down and design a database schema. You'd design a controller that would have certain actions. You'd write a bunch of templates that would have variable locations. You'd extend the controller to use these templates from the db to make views. You'd write pages which allowed editing of these values. You'd write code for sanity checking. You'd write unit tests. You'd do everything over again that you'd done before.
Slashcode, Scoop, you name it -- they were all written through the same ideas.
Ruby on Rails makes all the redundant parts go away. In the video (which I just watched, and finally gives me a compelling reason to learn and use Ruby), the person sits down and generates a basic controller for their blog. They then show that the basic templates generated will show text. It takes another 5 minutes to define a db called posts and generate a default action for it. The code is smart enough to just directly make the things like title and body editable widgets on the page. 5 minutes to have posted blogs!
Then the video takes 5 minutes to extend this by writing about 15 lines of code. This has a big effect: the listing of posts is abstracted out into a block that can be included in any page. The ordering is reversed. The title attribute is made a required field.
But what good is a blog without comments? In the final 5 minutes, the author quickly adds a comment table, generates a comment controller, says that posts own comments, sticks in 3 lines of code in the post view segment which do a foreach associated comment, display, and then adds a page to edit comments. They also (at the same time) show us the basics of the unit-testing framework you get "for free" (the basic test is return true, but he changed it to test if the comment post code worked with another 4 lines of code).
The entire thing took 15 minutes to write and had 58 lines of code. When the db schema changed, the code adapted -- the programmer did not have to rewrite the code. When the programmer wanted to change anything, the code would quickly bend itself to the task.
I dare say it's the sexiest thing I've seen yet. If they ever release a version 2 that allows for simple Javascript on the client for AJAX interfaces, there will be only 1 game in town for web development!
I'm not inexperienced in web design. I have written my own stuff to test ideas out, as well as participated in Scoop's development to a degree. Recently I've been playing with Drupal because all the basics are setup with it, and you can just extend it with modules. I can honestly say that while it took me an hour to setup Drupal (and another hour to get it completely to how I liked it) it a test config, I could probably replicate the base distribution plus the modules I use in Ruby on Rails within a day -- maybe 2, if I'm slow. It's that effective!
Re:Commercial equivalent is...? (Score:4, Informative)
ROR isn't as mature as j2ee struts+hibernate but it will be soon. ROR has tons of potential.
Re:Give ruby a quick try first (Score:3, Informative)
IIRC, there's a tutorial out there somewhere telling developers how to make Ajax-happy applications that don't break the BACK button and are bookmarkable.
Re:Perl people, check out Catalyst (Score:2, Informative)
Re:A better solution than PHP. (Score:1, Informative)
PHP is not insecure.
Ruby on Rails is not proven secure.
If Ruby on Rails gets popular, people will find security holes in it.
There was a major security hole (undisclosed) in one of the web applications created by the company that pimps^H^H^H^H^H"sponsors" Ruby on Rails.
Does that mean Ruby on Rails is insecure? No. But it goes to show that there is no inherent "security" in anything.
It's the application, stupid.
Re:Commercial/Enterprise use? (Score:2, Informative)
Nitro? (Score:3, Informative)
Re:Commercial equivalent is...? (Score:1, Informative)
Easy installation (Score:4, Informative)
Or for linux, install mod_scgi [mems-exchange.org] and follow the instructions here [rubyonrails.com]
It's stinkin' easy, I can do it in about 5 minutes. Any hosting admin worth their salt can even script it in about 10 minutes.
Re:Why rails annoys me... (Score:4, Informative)
if you're referring to a lack of odd people in the ruby community you'll be horrified to know there's many.
thanks for your post, all valid opinion .. i just suspect you're one of these highly intelligent programmers that trip over some minor features you find annoying and then blow your frustrations out of perspective.
(anyone who's farmiliar with rails will understand the underscores)
granted some of the method names are overly verbose! i've thought that often when looking through the APIs and docs. but that criticism needs to be tempered by pointing out the verbose methods are used very infrequently. 99% of the methods i use are small and concise, like: truncate(), h(), link_to(), redirect() etc.
The biggest annoyance was automated code generation
see this i'm finding hard to understand. when i want to start a new model and controller, i type a line in a prompt, and it makes the few files i need to begin. 'begin' being the operative word. there endeth the code generation.
my method of automated code generation is copy and paste.
If I made changes to the database, I either had to a) wipe the directory and start over reimplementing my changes. Or b) go through all the MVC code and find the references to the database
i've NEVER experienced this. never never never. and i have no idea what you're talking about. one of the real clinchers of rails for me is its use of ActionRecord to interface with the database. i modify my database constantly without breaking any code. the only case i can think of when what you describe could happen is if i were to rename a column in the database, then my row.name object wouldn't match. but i would consider a broken website due to this the fault of a stupid developer.
to be able to connect to my database, retrieve a record and update it, in 1 line in some cases, becomes rather neccessary for a developer once they've tried it.
will do all of these. i take a wee dance on the grave of large-scale php development everytime i use that.But I'd like to see the video of someone doing a large project in rails
and here is where i'm convinced that you are what i think you are (an intelligent programmer who's taken big issue over minor irritations). large scale use of rails is very easy to find [rubyonrails.org] if you visit the rails site . It's also very easy to find a larger list [rubyonrails.com], and a list of interesting apps [rubyonrails.com] to boot. granted, not moving pictures, but .. oh go away.
Re:if i'm new to web development... (Score:2, Informative)
I dunno, I don't think it's worth starting at the end : ) Ruby is a very nice clean language, and rails builds on that. Ruby isn't going away any time soon - Python and Ruby will probably supplant a lot of Perl over the next 10 years. I'd say you'd be better learning one of them rather than PHP, as you won't learn bad non-oop habits before tackling oop (which really isn't as hard a concept to grasp as people make out). Have a look at this tutorial for a flavour of what Ruby can do.
I'd say Ruby is the ideal beginners language.
http://tryruby.hobix.com/ [hobix.com]
try 2+ 2
then perhaps
zoo = "ardvarks " * 5
zoo << "parrots " * 2
zoo.include? "ardvarks"
Rails performs operations server-side which spit out html/xml whatever, just like PHP, however it separates out the programming stuff from your html templates, and the programming from the database stuff, so that you don't end up with a mess of code and sql and html at the end. You'll need to know about the Model View Controller paradigm (worth reading up on this). Basically
Model - Database wrappers
Controller - Programming
View - HTML templates
You need to install a database (take your pick), then you edit the config file to point it to your database.
Re:Can anyone offer a contrast to Gears and Django (Score:3, Informative)
Turbogears is similar in many ways to Webware, but there is a bit more setup involved. Atleast I had some trouble with that but this may not be the experience of others.
Between RoR and django - I prefer django because it can generate the database directly from the Model source code unlike in the case of RoR where it is a bit more involved. Django also generates (optionally) a good administration area which is quite usable even on a production environment; this is also lacking in RoR.
In the end, I prefer Webware over the rest because it gives me a whole lot more flexibility than either RoR or Django (I haven't used Turbogears a lot, so I can't comment much on that). Webware is closest to the J2EE style of functioning but yet stays clear of J2EE's idiosyncrasies. Also, there are more web hosts supporting python than Ruby and that kinda rules out RoR for most of the work I do.
Rails cost/benefit results (Score:4, Informative)
Installed Rails Apps (open source): (sorry, no links to my domain, must avoid
How is this different? I only worry about one Terms of Service, imposed by the web host. I control all aspects of the deployment of the Rails apps. So the blog is not just my blog, its a blog at my domain (or sub-domain if I perfer), and I control the databases that store its content. In fact, I control every aspect of the blog. For instance, I could make the blog appear and disappear based upon phases of the moon. Can you do that with any blog host, just by changing two links at a shell prompt?
The same goes for every other Rails app I have deployed on my server account. The Rails principles of "don't repeat yourself" (DRY) and convention over configuration, meant that once I installed one Rails app, the experience was immediately applicable to installing the rest. They all have the same directory structure, and the same configuration file for database connection, which is the only configuration file you must edit.
The rest just works, usually. You have to check your versions, and make sure your app and Rails work at the current version. I admit I have experience building server side web projects using VB6 DLL and ASP.NET, along with equally strong UNIX background, so I was able to tweak a few things and proceed when they didn't work the first time. Don't dispair, I was able to make it work after a few hours of checking on-line forums, and trying some suggestions.
Re:isnt ruby too perlish? (Score:3, Informative)
Ruby looks like perl because it uses the $ and @ prefixes, but it uses them for completely different purpose: in perl they denote type where in ruby they denote scope. This turns out to be a nice feature, since you should be using some sort of notation in your variable names to denote scope anyway. It also permits the concept of duck typing throughout the ruby community, which is a key feature in making the language natural and easy to use.
Furthermore, people tend to write ruby with a lot more OO than in perl. Again, much closer to python.
Finally, good ruby code uses blocks everywhere. You can do code block-like things in perl or python, but in ruby it's very simple, fairly clean, and a very natural part of the language. I think this is what really distinguishes ruby from python fundamentally as a language. RoR, like any app written in a ruby style, makes extensive use of this feature and it allows some of the things that make people so excited about rails.
Oh, and the culture of the ruby community is such that people tend to write code that's fairly consistent between authors. Python is similar, although this seems to be more a function of the language itself than the community's culture. Perl's culture, on the other hand, encourages creativity and variety between authors, making it hard to read other people's code unless you know most of the camel book. I've never had any trouble reading someone else's ruby code, and I know about as much ruby as I know perl.
Re:Why rails annoys me... (Score:2, Informative)
Can you give an example? I've used rails for atleast 5 different web apps and I've never had this problem. If you have a table called 'item' with a fields called 'price' then you have an object in rails called Item with a method called 'price' and you use it with: Item.price Seems straight forward to me and if you add a column called 'sale_price' to your table then your Item.price line doesn't need to be changed and you can automatically use Item.sale_price