Domain: rubyonrails.com
Stories and comments across the archive that link to rubyonrails.com.
Comments · 132
-
RubyOnRails.com
The question isn't PHP or Java, it's why aren't you using Ruby on Rails? Go check it out. PHP is a joke in comparison and Java far too complex. www.rubyonrails.com
-
Re:I bet it does it all by convention...NOT!
ActiveRecord isn't a code generator. The scaffolding scripts are code generators. ActiveRecord is an ORM system. In fact, AR doesn't generate any code at all, which makes it hard to believe you've even given the Active Record Overview a quick glance. The "convention over configuration" magic is one listed feature out of a dozen.
Yes, ActiveRecord is immature, and yes, it's clearly designed more with the idea of being used from the ground up. But, see, when you start slagging off AR because it's "just" something that it doesn't even do... -
Re:real world use?
Just answering the question in your subject: http://wiki.rubyonrails.com/rails/pages/RealWorld
U sage
The tutorials obviously don't go much beyond the basics, because they are *tutorials*. -
Re:standard authorization model
Authentication: There are some "login generators" out there. http://wiki.rubyonrails.com/rails/pages/Authentic
a tion
Authorization: It depends from application to application. If its a simple "is the user logged?", you can use something like this: (http://wiki.rubyonrails.com/rails/pages/HowToQuic klyDoAuthenticationWithLoginGenerator)
class AllMySecretsController < ApplicationController
before_filter :login_required, :except => [ :show_one_secret ]
def show_one_secret ...
end
end
Otherwise, you will need to do "manually". Maybe, using the before_filter in ApplicationController ;-) -
Re:standard authorization model
Authentication: There are some "login generators" out there. http://wiki.rubyonrails.com/rails/pages/Authentic
a tion
Authorization: It depends from application to application. If its a simple "is the user logged?", you can use something like this: (http://wiki.rubyonrails.com/rails/pages/HowToQuic klyDoAuthenticationWithLoginGenerator)
class AllMySecretsController < ApplicationController
before_filter :login_required, :except => [ :show_one_secret ]
def show_one_secret ...
end
end
Otherwise, you will need to do "manually". Maybe, using the before_filter in ApplicationController ;-) -
Re:XML?
Yeah, create a *.rxml file as a view and you can use the builder api:
http://api.rubyonrails.com/classes/Builder/XmlMark up.html
Or you can generate it from within your controller or what not, it's really slick, and very easy to use. -
Re:YASLFFFSC
That's the point. Anything can scale, if well designed.
My answer, actually, should have quoted this: "Rails definitely does not scale into the average J2EE project dimensions". To me, it means that "an app that have more than X users should be done in J2EE, not in Rails". Its simply not true, of course ;-)
Check http://wiki.rubyonrails.com/rails/pages/RealWorldU sage to see other 'real world usage' of RoR. There are some 'big' projects in this page. And yes, there's life outside the java-world ! -
Re:More than just ScaffoldThe developers of Rails are quite clear that they are trying to create a framework for developing a web applications, leaving the actual implementation of all the application logic, including security (or lack thereof!) up to the application developer.
That being said, I know of at least three secirity implementations being actively worked on and used (in order from least to greatest complexity):
1) There is a generator on the rails wiki:
A controller/model/view generator for easily adding authentication, users, and logins to your rails app.
http://wiki.rubyonrails.com/rails/pages/LoginGener ator
2) Bruce Perens has just released ModelSecurity:
ModelSecurity helps Ruby on Rails developers implement a security defense in depth by implementing access control within the data model.
http://perens.com/FreeSoftware/ModelSecurity/
3) ActiveRBAC
The goal of this project is to create a portable, simple but effective RBAC implementation with common User infrastructure and models for Rails.
https://rbaconrails.turingstudio.com/trac/wiki
There has also been considerable work done on a component model that will make these even easier to use and extend.
-
Re:Not so sure about this - I stil "don't get it"
The Rails homepage has a simple flow diagram of how Rails handles a request.
If this isn't helpful to you, perhaps you could be more specific about what you'd like to know; I'm sure someone would be willing to help you out. -
Watch the demo...
Before any bashes it as being a flash in the pan, watch the demo and see the framework that it provides and how natural it is to build webapps on top of. Truly an interesting language for the web.
Speaking of, why don't you check out my Ruby on Rails/Typo based blog, fak3r.com ;) be sure to try out that 'live search' (try 'bsd') for a taste of RoR/AJAX fun! -
Re:Object/relational mapping
(ActiveRecord *already* splits business logic between the DB and the application.. hint.. where are the column names and types declared?)
In the Ruby Migration script, in my projects at least.
See http://api.rubyonrails.com/classes/ActiveRecord/Mi gration.html -
Re:SQLObject rocks!
The SQL database abstraction layer is an important feature of SQLObject, that Ruby on Rails doesn't currently support -- you have to write database dependent SQL code mixed in with your Ruby code.
...So you don't have to change any of your Python code to port it to a different database, and you don't have to mix together two different notations, or quote a bunch of SQL strings in your Python code. It's a much more "pythonic" way of database programming than raw SQL.
I'm going to assume you haven't actually done any Ruby on Rails.
The only raw SQL you're ever forced to write in a RoR app is the initial data definition where you create the tables in your database. After that, it's all object-relational mapping as handled by the Active Record component. No SQL to be found, no rewriting code to port from one database to another. (Well - unless you count recreating the tables, or changing the name of the database driver in the config file.) -
Re:SQLObject rocks!
Tell me - how and where does one start writing SQL when you're using Ruby's Activerecord (which sounds like a building block for making Ruby objects similar to Python's SQLObject but without writing a single line of SQL)?
In pretty much every Ruby tutorial I've seen (including Agile Web Development with Rails ), the sequence goes: write the SQL, write the class, let Rails infer what isn't worth specifying.
More specifically: Rails makes a vast number of assumptions about the manner in which you store your data, but for the most part the assumptions are 1) reasonable, and 2) overrideable. This goes along with their philosphy of "convention over configuration," something any J2EE developer can likely relate to.
For example: Rails expects that if I create a class called "LineItem," that it can find a table in the database called "LineItems" that has an autoincrementing primary key called "id." If I create a "ShoppingCart" class, and in my class definition I put "has_many :LineItems", it expects a field in the "ShoppingCarts" table called "LineItem_id," ostensibly a foreign key (although it will handle the standard key constraints itself, w/o intervention from the RDB.) And so forth. But after you've written your data definitions, you basically don't have to write any SQL again afterwards. And if you find the Rails conventions to onerous, you can always override them.
Active Record has a new feature called "Migrations" coming out RSN which abstracts away even this initial involvement in the SQL, but I haven't so much as touched it yet. -
Re:JUnit and the people who don't use it...
Ruby on Rails (http://www.rubyonrails.com/ makes unit and functional testing very very easy.
It's incredibly easy. One of the reasons why I like the framework so much. -
Re:My answer
While Ruby may be a good choice for a 1st language (though I'd teach either python or java), DO NOT teach Rails.
Besides the obvious concerns of having to teach HTML at the same time, Ruby on Rails uses *way* too much magic for beginning programmers. There are all sorts of domain specific shortcuts that Rails uses. How are you supposed to teach iteration when the Rails uses something like collection_select? -
Re:I love PHP
try ruby on rails http://www.rubyonrails.com/
I doubt you'll be disappointed -
Re:Drupal"...hosting is scarce."
Though the first actual printed manual for Rails is, I think, only just entering shops now so it's all very developmental with no pun intended.
Though probably not complete see this list on the Rails wiki for a list of webhosts. Dreamhost.com is the first, as far as i know, major webhost to bring out full Rails support.
-
MVC?
I think the most promising thick-client app development model is the Model-View-Controller paradigm, as seen in such well-designed app frameworks as Cocoa for OS X, and of course Ruby on Rails, and although I see Skunkworks improving the "typical" drudgery of web-app dev, I would wonder what it provides in the way of code management when it comes time to test your controller without worrying about how the view renders it or the model stores it.
And I know this is a personal preference and all, but... Python's significant whitespace? Yuck... I hope you don't copy/paste much, you might forget a tab somewhere (not to mention, copying from webpages is an adventure in itself...) To me this is like drinking cider instead of beer. Why would anyone consider such a thing worthwhile? Just to avoid some begin/ends or curly braces?
Python does have a more complete library but I am pretty sure Ruby and friends are catching up (and of course, no real word on Parrot yet...) Ruby also just seems to do the whole object-oriented thing nicer (abbreviated getter/setters, everything is an object, no self-referential hacks or whatever...) -
Re:What's all the hype?
Rails is too MVC - it is *strongly* MVC-based according to their Website. That is what the RoR hype is all about.
-
Re:What's all the hype?
Rails isn't an MVC framework. Go watch the intro video and you'll understand -- http://www.rubyonrails.com/.
-
The distance will close. Here is some tech
Ruby on Rails has some easy-to-use AJAX features mixed in for good measure. And Ruby as a language is pretty nifty.
Scalable Vector Graphics, whenever most browsers get around to supporting it (the spec is kind of complex/full-featured), will enable another round of cool stuff. Especially when you consider the XML can be slurped in the background using AJAX
Now if the browsers would only fix/clean up the mouse and keyboard event model (jscript/ecmascript abstraction layers only help so much) and finish CSS2 support, we REALLY might get some interesting things going... At that point you could have your drawing app and eat xml, too... -
frameworks (patterns,devel tools) play a big part.
framework which supports powerful patterns, and have nice toolset with it is very crucial for choosing a certain language. PHP, java, perl, python has lots of good frameworks and new kid on the block is a ruby framework rubyonrails (http://www.rubyonrails.com/ you should certainly check it out.
-
Where are the best practices for each language?
I've been getting into Ruby on Rails recently, and am most excited by how Rails makes it very clear what the "best practices" for organizing and building your application is.
I have long despaired of learning that same information for PHP (with which I have much more experience). I've not yet found a book or other documentation that provides a concrete approach. And looking at existing large-scale projects, e.g., WordPress and others, reveal a myriad of different philosophies. It leaves developers basically trying different things out on different projects, and picking up their own favorite best practices as they go along.
While it's great that the languages are so flexible, well, sometimes it's nice to be guided to a known solid approach. It leads to consistency among and across many developers and time. This makes it easier for new developers to join or take over a project, or even for the original developer to do maintenance on components which were written long ago.
So, where are the recommended approaches for organizing and constructing large-scale applications for PHP (and Python, etc.)? -
Interesting question
Have you ever wondered what would it take to make your (unfortunately) IE-only web app to work on Firefox?
Is the answer Ruby on Rails? -
Language Bigot Alert!
My advice to everyone who wants dynamic websites is to use PostgreSQL for the database, it supports more of the SQL standard. But don't use JSP, use Ruby and Rails.
There are many reasons why I would give this advice:
- Java is not Free as in Freedom. This might not matter to some, but it does matter to me.
- Web applications in Java require complex application servers like Tomcat or JBoss to run.
- There are half a billion different web, database, and other "frameworks" out there for Java, and they nearly all incompatible with each other. You'll spend a week figuring out how to publish a SOAP call using JAX-RPC, for example. Spring, Hibernate, EJB, Tapestry, Torque, Struts... so many crappy ways to do the same thing!
- Java forces you to love duplicating things you've expressed in code in myriad XML configuration files.
- Jerks like this.
I always think of Java as more of a distraction for CS students and developers who like to secure their jobs behind layers of complexity and expensive purchases of commercial software ("we paid thousands for this, now we have to use it!"). This probably accounts for the success of Java in the corporate world.
Huge, enterprise applications can be written in any language; hell, Yahoo! runs on PHP for god's sake, as does Lufthansa's ticketing system. Languages are languages. What makes a "real" one in your eyes? The only thing you should be concerned about is code quality. Whether a language is interpreted or byte-compiled really means nothing.
-
Microsoft death watch
This is a transparent attempt on Microsoft's part to avoid being crushed by the rising juggernaut of web app development that is Ruby On Rails. If RoR has an AJAX framework, then ASP.NET has no choice but to follow in its footsteps in hopes of eking out some meager semblance of survival on David Hansson's waste products.
Bow, Microsoft, bow before your Ruby masters! -
Here's a link for Rails
I found the following Rails article quite helpful:
http://manuals.rubyonrails.com/read/chapter/82
In particular it links to the following:
http://www.quepublishing.com/articles/printerfrien dly.asp?p=328641&rl=1
Which is a very good discussion of characters sets in MySQL. I didn't realize it was so thorough. For instance you can have different character sets on tables, connections, and the server itself. Finally, it seems MySQL got something right. :-) -
Re:Show me a big app that uses it?Check here for a list of groups actively using RoR in production or developing with RoR. I know there are no Yahoo!s, Googles, or Amazons on the list.
As for Ruby offering you nothing that you can't do with Python I would argue that you can do things simpler, more concise, and more logically in Ruby. The code is cleaner so if you are picking up the code for something you developed six months ago things should fall into place easier.
IMHO Ruby == Prettier and more OO than Perl and Ruby == More powerful than Python
-
Re:Suggestions
I recommend you watch the demo videos on the rails page to get a taste of what Rails does. For example, you can see an entire basic but functional blog application built, real-time, in about 30 minutes (the second "seeing is believing" video). Once you see that, if you want to proceed, I'd skip the online tutorials & spend the $22.50 on the beta book. The quality & depth of the book is outstanding & it will greatly speed your advance with the language. Rails is really easy & at the same time kind of difficult. It's loaded with magic that makes tedious things trivial to code, but sometimes it can be a little difficult to grasp exactly what's going on. The book makes getting that understanding alot easier. If you're working with Rails you absolutely won't regret the purchase.
-
Re:explain for the newcomerI'm certainly no expert (yet) on Ruby on Rails, but, one of the things that got me very interested in it was this QuickTime video (47MB) in which a simple blog webapp is created from scratch in a very short time.
Some of it might not make much sense to you if you aren't already familiar with Ruby but at least it will give you a little taste of it.
There's a lot of good information at http://www.rubyonrails.com/, particulary in the Rails Academy section (http://www.rubyonrails.com/show/RailsAcademy. And, if you decide you want to learn more, I can recommend the book being reviewed, as I pre-ordered it a couple of weeks ago and have found the beta book very helpful.
-
Re:explain for the newcomerI'm certainly no expert (yet) on Ruby on Rails, but, one of the things that got me very interested in it was this QuickTime video (47MB) in which a simple blog webapp is created from scratch in a very short time.
Some of it might not make much sense to you if you aren't already familiar with Ruby but at least it will give you a little taste of it.
There's a lot of good information at http://www.rubyonrails.com/, particulary in the Rails Academy section (http://www.rubyonrails.com/show/RailsAcademy. And, if you decide you want to learn more, I can recommend the book being reviewed, as I pre-ordered it a couple of weeks ago and have found the beta book very helpful.
-
I Didn't Know What Ruby Was, But I Found Rails
For all of those that want to knock this product, check it out first. Just head to http://www.rubyonrails.com/ and view the video on the front page to see how easy it is to build a basic web application.
I have been developing with the Rails framework for a little over a month and have been far more productive than I ever was in PHP or J2EE.
Rails will make you love Ruby, or at least respect it. -
Re:does RR have ....
stuff like contexts in java where you can have a session context and store objects in it?
Yes, you can store objects in a session context. Sample and gotchas here at the RoR wiki.
Also is there something that sync's sessions from one server to another to support load balanced environments?
More than something, there are numerous ways to support this. You can store you session data in temporary files on the server (the default), share it using Distributed Ruby, store it to the database for retrieval... So yes, your applications can be load balanced across multiple servers while maintaining session data.
Scott Barron did some benchmarking of the various methods, if you're interested in that sort of thing as well. -
Rails posts prediction ...
I predict there will be basically two categories of posts about Rails.
Either, one, that Rails is so amazing that after you use it sex seems laughably trivial by comparison, even and especially you count the production value -- one can, after all, only have one child (on average) using sex, but with Rails, dude, I HAD TEN.
Or, two, that Rails is no big deal, it's just another MVC re-think, heck I rolled one of those myself one afternoon a coupla years back, yeah it ruled but, you know, I'm really into that Java thing now. Besides, Rails is no good for BIG projects, for that you need Hibernate and a crane.
So I'll post one for the middle-of-the-road. Rails rules. I love it. I've reimplemented, in a week-and-a-half, a fairly large application that took me two months to do with Python. It's not a fair comparison because with Python I used Webware but did everything, like user management and logging, with no starting point, and also the first time around I wasn't as familiar with the problem domain.
With Rails I used the Salted Hash Login Generator which got the basics of my user login and management done in one fell swoop, an hour or two of work. I also re-used the view code from the Python app.
But the rest of it was fun. I enjoyed it. Things were done quickly and the API is awesome. ActiveRecord is not Hibernate -- yes, Javapeople, we know, we know -- but it's good. It's really good and super easy. And while there's some magic going on behind the scenes with Rails, it's not hard to understand at all.
That said, yes, if you're an online payroll system for IBM, Rails won't cut it. There are flaws, but for day-to-day stuff, not too many. It's updated very frequently, too.
My only complaint is the ubermensch of Rails, Dave Heinemeier, who, while smart, is also all too aware of it, and frequently shoots his blog off about topics which go beyond Web frameworks and into areas of either glib tech-prejudice or, at times, more subtle see-how-smart-I-am dorkposts -- the most insufferable species of Geek.
Otherwise, I strongly encourage anyone to check Rails out. It's great and a *lot* of other frameworks in other languages could stand to pay attention to the innovations in Rails. These innovations aren't so much technical epiphanies, as they are the meeting of many good ideas in one place, along with enthusiastic support and a lot of glue. Ruby's fun, too.
Check out, also, the frameworks from other languages which are shamelessly stealing from Rails:
Subway (Python)
Catalyst (Perl)
-
Re:SuggestionsJavaLobby's Rick Ross suggests you try Rails!
http://weblog.rubyonrails.com/archives/2005/06/16
/ javalobby-founder-ruby-on-rails-is-a-powerhouse/ -
Re:ASP.NETOf course MSDN uses ASP.NET -- what did you expect? They also used ASP back when that was en vogue, and ASP is, well, not better than PHP. Livejournal uses Perl/MySQL, Wikipedia uses PHP/MySQL, for example. *Your* point was that ASP.NET or J2EE are the only way to build large sites. Enumerating large sites that use ASP.NET or J2EE doesn't prove this point; enumerating large sites that use something else disproves it. Most web apps are naturally scalable because the only shared parts are the database (cluster) and the session data (for which fast methods exist for sharing the data among machines in your web server farm), so if everything else fails, you can just throw hardware at the problem to speed it up as long as your database scales.
Rails has multiple possibilities for caching web content at different granularities. You could at least have googled for "Rails caching" and incorporated the results in your posting to make it look as if you'd made a comparison.
Essentially everything but assembler and C/C++ uses some variant of "managed code that protects from errors", and Ruby is no exception.
The Ruby and Rails communities are very competent and helpful, and Rails itself is actually easy enough that you can read and understand the source code in a few days. I strongly dispute the claim that big real-world applications (that's those containing large amounts of business code, not just a dragged'n'dropped bunch of databound controls) require less code in ASP.NET than in Ruby. Ruby's OOP features and its meta-object protocol (i.e. runtime "hackability" of artifacts of the language itself) make it easy to write very clean, high-level, declarative code.
Let's just say that you may know something about J2EE and ASP.NET but not much else
:-p -
Re:PHP Rails Ripoff
FastCGI is the best way to run a production Rails app. There are many web hosts supporting Ruby on Rails, see:
http://wiki.rubyonrails.com/rails/show/CommercialS upport
which lists eight such web hosts. -
Re:Rails, great for those fed up with J2EE.
-
Re:Rails, great for those fed up with J2EE.
-
Rails -- in addition to or instead of PHP
I'd strongly recommend Ruby-on-Rails in addition to or even instead of PHP. Although there is a lot of PHP out there, I can't think of a reason to use it for a new project if you knew both PHP and Ruby, or if you knew neither and had to learn one or the other.And I can think of a few strong reason to use Ruby: tainting, true object orrientation, no overflows,..
--MarkusQ
-
Seriously, look at Ruby on RailsJust spend an hour or two looking at the now-ubiquitous recipe book demo, and see if a system like that could suit your site-building needs.
Looking at what my co-worker just managed to pull out of his hat in a week or so (combination SOAP/XML-HTTP client with revision control on the data, for web-hosting-ish stuff) you may find the hardest part is finding excuses to not convert your other stuff over
:PThe most difficult thing I think you'd run into based on your spec is the label printing stuff, but if you found a web-based solution for it in PHP I'm sure the Ruby version should be comparable. Hell, as far as that goes the easiest way I can think of is just take a copy of Access, point it at your database, and use it to generate the right query and design your labels...
-
Ruby on Rails and AJAX
Ruby on Rails has been working on this for some time, at least since the 0.11 release back in March. This is a wonderful technique for speeding up web applications. Browse around the web site, or hang out in IRC, and you will quickly see what all the excitement is all about.
-
Ruby on Rails and AJAX
Ruby on Rails has been working on this for some time, at least since the 0.11 release back in March. This is a wonderful technique for speeding up web applications. Browse around the web site, or hang out in IRC, and you will quickly see what all the excitement is all about.
-
Re:Perl still used?
I run a lot of webapps in Perl, and from time to time I run into DRY (Don't Repeat Yourself) stuff.
Currently I am considering Ruby on Rails or Catalyst, wich is an MVC written in perl.
Quote from the Intro.pod:
Catalyst is an elegant web application framework, extremely flexible yet extremely simple. It's similar to Ruby on Rails, Spring (Java) and Maypole, upon which it was originally based. -
I am going to be a hero very very shortly...
...when I revamp my company's intranet with this.
-
Re:OT: hello
Hi MarkusQ -
Right on! Hey, looks like you're doing a lot on the ROR wiki; good times! -
Re:This is irrelevant for most websites
And you would suggest choosing hosting providers that serve on IIS in order to boost search result rankings?
Not on your life. I'm a L'amorra fan.I don't understand what you're trying to say.
I was saying that the user does have a choice; that doesn't mean that they are all equally good, or that playing into someone else's abuse of monopoly is the best way to decide between them. But you still have a choice.--MarkusQ
-
Re:Geez Geert
Didn't you get enough arguments with Rails users last time?
Paradox, I don't remember getting much arguments, I do remember getting much flames and trolls.
I'm not sure anyone has told you that a lot of stuff that was included in Ta-da's linecount was done so only because of an ideal of fairness. Caching, for instance, is used for the first time in Ta-da List (and is prepared for extraction). So it goes into the linecount. Personally, I wouldn't have included these things. They were extracted into the framework.
Fyi, I asked details about what went in the linecount exactly in the comments here: http://weblog.rubyonrails.com/archives/2005/01/19
/ make-your-ta-da-list-today/Oh, and in DHH's 'says-it-all' comparison screenshot, the list act is not in Ta-Da but in the framework, so don't come telling me it was extracted afterwards.
Your point is not well-served by throwing a tantrum every time Rails gets some positive press. Take the moral high ground.
I only react to posts that attack me directly, like the one that started the thread, don't pull things out of context again.
-
You want programmatic generaton of HTML?
Rails comes with this. Indeed, it's preferred for many situations. The template method is best when you're not working with web designers who don't know any programming language and want to make mockups.
It's called XML::Builder, and it's pretty neat. Check it out at this link.
It's nice for generating "Semantic Web" markup. -
Re:No, you are simply ignoring what I am saying.
Hm. Interesting.
Anyways, Rails is not 1.0. Changes are to be expected. It's not supposed to be perfect yet. And the developer should know the quoting rules for the DB that he/she's using.
And it's not like there's no documentation out there for securing your web app. Oh wait. http://manuals.rubyonrails.com/read/book/8