Domain: rubyonrails.org
Stories and comments across the archive that link to rubyonrails.org.
Comments · 199
-
Re:What exactly is "on rails"? Someone help me out
Rails is a Web 2.0 AJAX-enabled test-driven RAD environment in the MVC paradigm! (Bingo!)
More seriously... Rails is a rapid web application development framework. It's written in the Ruby language, hence the "Ruby on Rails." It abstracts things quite well, leaving you to worry about actually implementing the program logic (and site design) rather than managing database connections, writing getter and setter methods, sanitizing user input, and all that oh-so-fun stuff.
If you've got QuickTime, the "Show, Don't Tell" video does a pretty good job demonstrating the very basics of what Rails can do. The video is fairly large and best viewed outside a browser window.
I went from zero knowledge of both Ruby and Rails to a full-featured application in less than a week, so I'm happy with it. -
Re:Thanks for the career, PHP!!Care to share your personal experience with Ruby? Had you used PHP or ASP or Perl beforehand? What was the learning curve like? How long before you were building complex web apps? What do you like about it so much?
When learning Ruby, there is only one idea that you will need to expend some effort getting your head around: blocks. Once you grok them, though, you will appreciate the power and elegance they give you. Using an API that takes blocks is nice. Being able to use blocks in your own APIs is even better.
In fact, Ruby fans wax rhapsodic about blocks so often that it irks a lot of Lisp and Smalltalk hackers who have had them for decades. It's not a new concept, just new to a lot of today's young programmers who grew up on C-like languages (myself included).
Other than blocks, I found Ruby's learning curve to be astonishingly short. In fact, I think it is a great first programming language. In the past I've done serious work in ColdFusion, Java, and C#, and dabbled in C/C+++, PHP, Python, Perl, Lisp, and Visual Basic. Other than blocks, I found Ruby to be the easiest to learn by far (and blocks are the best part).
The pickaxe book is the one you want. Also check out Ruby on Rails if you're primarily interested in webapps (I've only barely looked at it, but a lot of people seem to be ga-ga over it).
-
Congratulations PHP
You've done such a wonderful job that it's time you stop now and let something better take over
:) -
Get them started right......use Ruby on Rails. It enforces Model-View-Controller separation, and you can have a simple, functioning "blog" or "shopping cart" application in about an hour.
PHP is a good language for certain tasks, bit it forces you to focust on all kinds of tedious minutia that could scare off newcomers to the field. The big thing for an introduction is to give people a feeling of success and the satisfaction of creating something that functions properly. Besides, developing web applications without a webapp framework is hell. Case in point - the number of horribly broken PHP "frameworks" floating around out there.
-
Re:Thanks
-
OTOH, I look forward to...
...many VBX applications being run out of town on a Rails. It would surprise me if KNoda couldn't script in a variety of languages, and surprise me even more if it remained so for long.
-
Re:SecurityI agree the tutorial thing is not specific to ROR. But:
scaffold is ROR specific, and is vulnerable. So you either don't use scaffold (which is one of the biggest selling points of ROR) or your app is vulnerable. There is a patch for that here. The fact that such an obvious security bug exists is worrying.
Their bug tracking system is ROR specific. and it is also vulnerable.
-
Ruby Rocks !If you haven't used it, you might want to give Ruby a try.
I was stunned when I used the Ruby on Rails package and had content driven web-apps up and running in a few hours, without the headache of deployment descriptors and no need to wrap them up in War/Jar/Ear files.
The language and it's syntax are VERY lean and elegant. It's almost as if Ruby is what Java could have been (without the bloat)
And with the GUI, Database, XML, Network, and the rest of the other bindings it is fairly complete runtime environment.
-
Re:Advantages?
If you don't already know Python, I suggest (as an alternative) Ruby ( http://www.ruby-lang.org ) and Ruby on Rails ( http://www.rubyonrails.org ). I personally prefer Ruby as a language over Python. I wanted to learn a new language for server-side web programming, and took a month to do my research on all sorts of dynamically-typed languages. Though currently less popular in the US than Python, Ruby is much better -- in my opinion. (No language flame wars, please.) I almost chose Python purely because of Zope, but after looking into Zope for a week I didn't "get it", and I went with Ruby. And then...Ruby on Rails came out. Holy cow, it is AMAZING. It's like programming with butter. (Whatever that means.) All yesterday as I worked with it I repeatedly caught myself grinning because it was so easy, so simply, and so joyous.
-
Re:Python Zealots Are Like Apple Zealots
The number one complaint about Python is the forced use of whitespace instead of block begin and end delimters
This is why a lot of people are choosing Ruby over Python (certainly it was the main reason I chose Ruby over Python 4 years ago - now that I know Ruby better I'm glad I made that choice for other reasons as well).
It's interesting that we're seeing articles about how Python is taking the enterprise by storm just about the same time that Python usage has probably reached it's peak.
In the Python vs. Ruby race, I'd put my money on Ruby. Sure, the number of Python users is probably 4 or 5X the number of Ruby users right now, but I suspect that to turn the other way within 2 or 3 years. Why? Well, the whitespace issue is only one reason, but it does make it difficult to use Python as a templating language (as is commonly done in Ruby on Rails rhtml, for example). Ruby is a more flexible language than Python. Ruby is also more feature-rich (continuations, code blocks which make it easy to define your own constructs which look like a natural part of the language)
Ruby on Rails is generating a lot of excitement and bringing in a lot of new people. It's a great showcase for what is possible in Ruby. -
Re:What is this?
You can always use Google. Ever heard of that tool? If not, check out Ruby on Rails Site.
-
Spot the KDevelop virgin?
Or perhaps he should try Ruby on Rails? Hard to get more integrated or developmental than that.
-
Re:You should always...
With some languages and some frameworks, you're right.
-
Re:I wish there was RHP instead of PHP
There is this. I am a Ruby convert as well. I think it's so much cleaner than other scripting languages. Most of it "just makes sense." I personally am not using it not so much as a web app framework as a replacement for my company's plethora of ASP work. Using eRuby on Apache I hope to keep things moving along...
-
Re:Can't Jack into my database
You should post this question to the RoR mailing list with more details. Plenty of friendly people there to help you out: http://lists.rubyonrails.org/mailman/listinfo/rai
l s/ -
Re:Plurals?
I'm responsible for the extended plural rules. The argument was to try hard to do the right thing in many cases. The rules are documented in detail in the documentation of the default implementation of table_name(). Note that we knew upfront that we could not handle all the cases, we're just trying hard to do the right thing automatically. If the automatic table name detection fails you can still override it fairly easy by doing def self.tablename() "foobar" end inside your ActiveRecord class. You can also override the method on ApplicationController and implement your own guessing for your application.
Hope you find the way this was designed usable. If not I'd be pleased to receive feedback on how to improve the situation.
-- Florian Gross
-
Ruby on Rails
Ruby on Rails is a nice newer platform for doing database development.
-
Ruby on Rails
A bit off topic, but according to this post, Dave Thomas's next book (of Pragmatic Programmers fame) will talk about the Ruby on Rails framework, the latest craze in the Ruby world.
-
Re:I've said it before, and I'll say it again
-
Re:I've said it before, and I'll say it again
-
Obsolesence knows no age limits.Where I see the big stupidity with regards new technology is not so much in "old programmers stuck on Cobol" but younger Java programmers aspiring become bureaucrats through type declarations.
The authors of Perl and TIBET(tm) are all over 40. The authors of Rails are largely under 30 but they aren't stuck on Java's marching moronism.
-
Re:Scary (saracasm)
I'd rather use Seaside for web applications or Ruby on Rails for a web-based interface to a database than use ASP.NET. Seaside is probably the most advanced thing I've seen to date, you should check out the liveWeb project that is built with it, it's gonna blow you away.
-
Here's the fixed URLLooks like there's a space in the first URL.
-
Re:Why not use Jython? or Groovy?
Perhaps you should just link to the rubyonrails site instead of claiming what it does/doesn't provide.
Ruby on Rails provides an amazing object-relation mapping for SQL databases called ActiveRecord. It uses ERb inside of ActionPack to provide JSP-like templating.
If you want a MVC development stack, RoR provides it. If you want distributed objects, message passing, etc just look at other standard and non-standard ruby libraries.
The most beautiful part of Ruby on Rails is that it doesn't required 100k lines of XML to configure it like Groovy and other similar frameworks.
-
Re:Why not use Jython? or Groovy?
Perhaps you should just link to the rubyonrails site instead of claiming what it does/doesn't provide.
Ruby on Rails provides an amazing object-relation mapping for SQL databases called ActiveRecord. It uses ERb inside of ActionPack to provide JSP-like templating.
If you want a MVC development stack, RoR provides it. If you want distributed objects, message passing, etc just look at other standard and non-standard ruby libraries.
The most beautiful part of Ruby on Rails is that it doesn't required 100k lines of XML to configure it like Groovy and other similar frameworks.
-
Re:Why not use Jython? or Groovy?
Perhaps you should just link to the rubyonrails site instead of claiming what it does/doesn't provide.
Ruby on Rails provides an amazing object-relation mapping for SQL databases called ActiveRecord. It uses ERb inside of ActionPack to provide JSP-like templating.
If you want a MVC development stack, RoR provides it. If you want distributed objects, message passing, etc just look at other standard and non-standard ruby libraries.
The most beautiful part of Ruby on Rails is that it doesn't required 100k lines of XML to configure it like Groovy and other similar frameworks.
-
Ruby on Rails, and Trails
This month's meeting at my local Java user's group there was an impressive demo on Ruby on Rails. The presenter built a blogging application live in front of the group, literally in 10 minutes or so. Prior to this demo I had pretty much written Ruby off "just another alternative to perl or python" but I have to say that Rails looks really impressive, enough so that I'm taking a closer look at Ruby.
One of the guys in our user's group, Chris Nelson, is building a similar framework for Java - called Trails. He also built a blogging application live during the meeting. It took him a bit longer - perhaps 15-20 minutes. It was impressive as well, although I will say that for Trails you need to know a fair amount about Hibernate and Tapestry. Realize that he's been working on this only for a few months and suddenly you see that this work is very impressive too.
Anyone interested in developing web apps might want to check these projects out - very impressive stuff! -
ruby alternative
well, since someone posted a php alternative i figured i'd post the ruby alternative too
:P
ruby on rails. very nice web framework -
Ruby may be the correct answer to PHP
Try out http://www.rubyonrails.org/
Its a simple framework written in Ruby that should be well liked by PHP programmers. You get all the simplicity of of the LAMP stack but using a better designed langugage, Ruby. -
Help is on the way...
Rails.
You'll be hearing a lot about it in the coming months. -
Re:awesome book, awesome language
AND you don't even have to create the basic getter/setters! Ruby classes have a built-in class method that creates them dynamically:
class Customer
attr_accessor :first_name, :last_name
end
What's also handy is you can write your own methods which work like this to dynamically generate repetetive blocks of code for a class or object. ActiveRecord makes great use of this with things like:class Author < ActiveRecord::Base
Which then gives you things like Article#author (and Article#author=, letting you change the relation by assigning another Author object to it), Article#categories?, Author#articles, Author#articles?, Author#article_count.. mmm, metaprogramming tastic.
has_many :articles
has_one :account
end
class Article < ActiveRecord::Base
belongs_to :author
has_and_belongs_to_many :categories
end -
Re:What demand is there for RUBY in the workplace?
These Guys just hired about 4 Ruby programmers to work with Rails (a Ruby-based web application framework that uses an MVC model that's generating a lot of interest in Ruby)
I suspect that you'll see more small shops using Rails (and thus Ruby) in the coming months. -
Re:Web programming
The review mentioned web programming, does one need a specific platform installed or it "just runs"?
I'm not sure what you mean by platform or "just runs". If you mean, do you need a certain OS? No. Do you need Apache in particular? No, though Apache and Ruby work very well together. Do you need any external web server? No. One of the standard libraries that comes with Ruby is WEBrick, which is a standalone webserver. You can get Ruby running web apps using WEBrick on any OS, no other software required.
Along those lines, let me throw in a quick plug for Ruby on Rails. Rails makes web application using the MVC model very quick and easy. The default setup includes a WEBrick servlet so you can have your application listening for requests minutes after installation, literally.
Visit #ruby-lang and #rubyonrails on freenode for more information about Ruby in general or Rails.
Jacob Fugal
-
Re:Have you tried Ruby?
The availability of additional packages is currently rather limited.
The new second edition Programming Ruby by Dave Thomas & co. has an excellent section on built-in classes and modules that starts at page 427 and goes to page 777 - and even it is not exhaustive. I've done Ruby programming for pay and I've not found that Ruby was lacking any functionality that I've needed. Sure, Perl's CPAN is bigger than Ruby's RAA, but there's quite a bit of redundancy in the CPAN as well. I suspect that we're gaining rapidly on Python's repository as well.
I really liked the idea of everything being an object until I realised that beyond what Python already offered, I had no need for this level of object orientated-ness.
Different strokes for different folks... I very much appreciate Ruby's Smalltalk level of OOness.
What it really boiled down to was that I couldn't find a single good reason to make me adopt Ruby
How about Ruby's blocks? Or the fact that Ruby's lambdas (closures) allow you to do a lot more than Python's do.
...but I doubt it's evey [sic] going to arise.
Two links:
Rails and Instiki
Both are generating quite a bit of buzz even outside of the Ruby community.
-
If you don't have "a few weeks" to learn..
..try Ruby on Rails.
It's a complete MVC framework for the Ruby programming language and it makes Hibernate, Spring, Struts, XML config, Java, look like a BAD JOKE.
Just do yourself a favor, go to the Rails web site and watch the demo video.
Start writing high-power web apps NOW, not after "a few weeks of learning". -
If you use Ruby, try ActiveRecordIf you think Hibernate is the ultimate in ORM systems, or that 50 pages of documentation are necessary before you can get started, you might want to take a deep breath and look into ActiveRecord for Ruby.
Here's how to set up the class for a Customer:class Customer
Yup, that's it. It reads the definition from the database and creates the appropriate accessors dynamically. How long does that take with Hibernate?
end
Now let's add an Order object, and tie it to the customer.class Order
Pretty cool huh? Unless you get paid for the hour, why wouldn't want this in your own projects?
belongs_to :customer
end
class Customer
has_many :orders
def name() "#{last_name} #{first_name}" end
end
c = Customer.find_first "last_name = 'Smith'"
if c.has_orders?
puts "orders for #{c.name}:"
c.orders.each { |o| puts "order #{o.id}" }
end
Come in from the cold, try Ruby! -
Still too heavyHibernate is still too heavy. If writing a bunch of config files isn't for you, consider Rails.
Some related links, including links to reactions of people coming from Java to Rails:
http://www.loudthinking.com/arc/000297.html
http://www.loudthinking.com/arc/000291.html -
cool!
I always recommend Resin for Java stuff. This makes it all that much easier to recommend to folks who are allergic to non-open-source products.
Of course, I've graduated from Java for most projects since I've discovered a much nicer language, but for those big grunt-team projects Java still has it's place. -
Re:For those who wish to buy this book
Why argue over "Coke or Pepsi" when you can try a fine wine?
And you can do web development faster than you ever thought possible. just watch. -
Re:So... work with me here....
> Rails
Yup, and since it's installable via a Ruby Gem it's easy to get it running.
> why we're seeing a story on this
I bet the O'Reilly folks would accept an article on Rails... -
Re:So... work with me here....
No, it's a tree-based interpreter like the standard Ruby one AFAIK.
I'm still wondering why we're seeing a story on this so long after it's release, when the likes of Rails, one of the more exciting Ruby libraries in recent memory, gets completely ignored.
Of course, nobody here would really be interested in a powerful, easy way to develop web applications with practically zero configuration. It's just not *fun* without 800k of XML just to configure your ORM library :/ -
Ruby is also quite real
It's being used at NASA, NOAA, Intel (check out the next Intel Compilers Evaluation CD [I think they call it the developer's CD now] - it's got Ruby on it
;-). There's the Rails Web app framework that's getting rave reviews.
Lots of cool stuff going on in the Ruby-world now. -
Re:PHP is a Great Language
"They're all very well organized"
Are you kidding? Here's a small sample of string and type handling function names (about as standard library as it gets):gettype(), is_int(), strlen(), str_pad(), parse_str()
Is is strfoo(), or str_foo, or foo_str() or foostr() or what? What it is is fairly well documented, but that's pretty much a requirement with an API as large and messy as PHP's.
It is similar to Perl and C in some ways; that's not a positive note in my book though.
Now, why hasn't Rails hit SlashDot yet? -
tough to write good docs
It's tough to write good docs. Once a client of mine wanted very thorough documentation (API docs, user's manual, etc) for a project beyond the README's and INSTALL's I usually bundle with the code.
I immediately doubled the estimate. Why? Because you are basically writing the logic of the app all over again, except in this funny programming language called "English". And when you update one you have to update the other. Not to mention you have to update your unit tests too (which is another thing most programmers don't do).
I'm not trying to make excuses or saying that we should skip documentation, it's just that it doesn't "scratch the itch". I don't believe that open source exists because of altruism, but because somebody solved their own problem and didn't keep it from the world. So we need folks who are truly interested in documentation (like technical writing geeks).
As open source grows we need to find all sorts of folks: technical writers, usability experts, designers, artists, testers.... we should also not be afraid to hold "fundraisers" to hire an outside team to do this. Wouldn't it rock if Mozilla, KDE, Gnome, etc., had a *thorough* going over with a talented usability team?
Anyway there's one concrete piece of advice I can give any open source programmer, especially if its not a gui-based tool: PUT EXAMPLE USAGE ON THE FRONT PAGE OF THE WEB SITE!!!
This annoys me to no end. Too many sites just have blocks of text describing how great their stuff is.. but no example of setting up a config file, running it from the command line, etc.
I would love to see a step-by-step up and running document, nothing fancy. Show some examples of what your config files and so forth look like. How about screen shots of command line operation? If it's too complicated to show in a few pages, *simplify it*.
The quicker I can get your program up and running, and the less work I have to do, the less I have to hack in my existing configs and so forth, the faster I will be sending you patches.
Positive example: The awesome Ruby on Rails framework has a setup *movie* showing exactly how to go from zero to app in 10 minutes. I wish all projects had something like that, and more importantly, I wish all projects were SIMPLE enough to demo in a few minutes.
Negative example: I was wondering if Perl's Template Toolkit was the right template system for me. I was looking for a very basic kit that could mix Perl directly with HTML (a-la PHP) with no fluff and bloat. I couldn't see any example on the front page and after a minimal amount of searching, I still had no idea what it was like to actually *use* the damn thing. Just bullet lists of features (which are shared by pretty much all similar systems).
So, as a first step down the road of good documentation, try this user-focused idea: give some examples up front. -
Re:But how to decide?
I am a big believer in interpreted dynamic languages (my favorite is Ruby). PHP is a dynamic language though you can't really push it as far as Ruby or Perl, it does let you work a lot faster than Java.
And with PHP5's type hints and real exception handling (yay), you get a lot of the goodness of Java, but 100% open source, and no compiling needed.
So my recommendation is to almost always use PHP (and some kind of struts-like framework, though a really good one hasn't emerged yet, you can always roll your own) for all but the most complex (10 or more developers for instance) projects.
The complexity of Struts and servlets and so on is SO high. J2EE is a nightmare as well. For 95% of projects you never need that kind of loosly-coupled design.
I'm also VERY eager for the release of Rails (a Ruby app framework) which looks to be a highly pragmatic and dynamic version of Struts. I'll probably use some of the ideas in my PHP code, where the language allows. -
Re:I heard someone is looking for Ruby? :-)
Hey, web stuff is easy with Ruby as well. But I don't have such examples for you.
I have:
- Instiki, a Wiki completely written in Ruby. Has Revisioning Support, Internationalization, Feeds, Exporting to HTML and Latex, multiple Markup engines and more. I think the work on it started like three months ago.
- ActiveRecord: It is a object-relation mapping layer for Ruby. Just have a look at how natural it feels to use it and you will see what Ruby is able to do for you.
There's more like web engines that use Continuations to create a sequential application metapher, great templating engines and even multiple ways of making Ruby very performant in Web Applications.
-
Re:I heard someone is looking for Ruby? :-)
Hey, web stuff is easy with Ruby as well. But I don't have such examples for you.
I have:
- Instiki, a Wiki completely written in Ruby. Has Revisioning Support, Internationalization, Feeds, Exporting to HTML and Latex, multiple Markup engines and more. I think the work on it started like three months ago.
- ActiveRecord: It is a object-relation mapping layer for Ruby. Just have a look at how natural it feels to use it and you will see what Ruby is able to do for you.
There's more like web engines that use Continuations to create a sequential application metapher, great templating engines and even multiple ways of making Ruby very performant in Web Applications.
-
Re:Running This
Some would say that any use is inappropriate for PHP. Not me, but it's certainly one of the less interesting open source languages about.
For instance, Ruby's web application support has been rapidly gaining ground for quite a while now; fancy state-keeping systems last seen on LISP; a powerful server framework now integrated with the standard library; an innovative object-relational mapping library which makes interfacing with SQL databases childsplay; an interesting new web application framework which is causing quite a stir; an amazingly easy to set up Wiki server; a nifty template library gaining fancy bytecode based acceleration and native-C compilation. Every one of these projects alone is probably more interesting to the average developer than yet-another-OpenGL-module for an interpreted language... isn't it?
Maybe this is why this is News for Nerds, not News for Geeks ;) -
Re:Running This
Some would say that any use is inappropriate for PHP. Not me, but it's certainly one of the less interesting open source languages about.
For instance, Ruby's web application support has been rapidly gaining ground for quite a while now; fancy state-keeping systems last seen on LISP; a powerful server framework now integrated with the standard library; an innovative object-relational mapping library which makes interfacing with SQL databases childsplay; an interesting new web application framework which is causing quite a stir; an amazingly easy to set up Wiki server; a nifty template library gaining fancy bytecode based acceleration and native-C compilation. Every one of these projects alone is probably more interesting to the average developer than yet-another-OpenGL-module for an interpreted language... isn't it?
Maybe this is why this is News for Nerds, not News for Geeks ;)