I want to create a content management system as my final year university project and I’m currently considering doing it in Ruby. Can anybody advise me as to what would be the benefits of using Ruby instead of PHP (which seems like the current industry standard to me). The only thing I don’t like about Ruby is the documentation and availability of literature on the subject. If I want to create a CMS using PHP and MySQL there are dozens of books to choose from, but how about Ruby? Where can I find decent information on how to create a CMS using Ruby?
Ruby is much better as a language. It supports many “advanced” things like call/cc, metaprogramming, lexical closures. But PHP, on the other hand, is focused on web development, and is available on many webhosts.
There are no “create your own CMS” tutorials for Ruby (while there are lots of these for PHP).
Well, yeah, that’s pretty much what you would expect in a forum named “Ruby”, right?
But I also think that Ruby on Rails has some key advantages over PHP and especially the Java framework. I especially like the idea of mapping tables and entire databases to classes/objects. This should make things a hell of a lot easier (if it really works!). I have spent the last couple of months learning Java, JSP, and JSEE (a module at university) and I can safely say that Java SUCKS when it comes to web development. So I am looking for alternatives.
Has anybody heard of any more content management systems that were developed in Ruby on Rails? I’ve only seen one so far it hasn’t convinced me. How come there aren’t more? RoR seems to be the kind of design framework that web developers have always dreamt of, so how come there are so little CMSs out there? Any particular reasons?
Hey, that’s great news for me! I assume you have developed a CMS in another language before? 2 weeks is pretty fast… I have never made any CMS before, so this would be my first time. Can you recommend any book or resources that you used while developing your app? Thanks a bunch.
I will warn you though: I’ve been playing with rails on and off for almost a year now, and I built most of the CMS about 2 months ago. Things might not go as quickly for you, but it should still be nice to develop in
Well, yeah, that’s pretty much what you would expect in a forum named “Ruby”, right? [/QUOTE]
While better may be a subjective term, it’s certainly an objective fact that (as Fenrir remarked) Ruby provides abstractions that make it a more powerful language than PHP. Programming languages are not created equal, and Ruby is way further up the curve towards Lisp than PHP. This is as it should be, since we’re comparing apples and oranges.
Well, I suspect one reason may be that at the moment, Rails-related work is in very high demand and is lucrative enough that while many people (including me) are certainly creating proprietary CMS systems with Rails, there isn’t necessarily enough interest and free time to work on open-source projects for the “greater good”.
Personally, I’ve often entertained the notion of creating an improved Drupal clone in Rails, but as the 48-hour day hasn’t been invented yet, there just hasn’t been time
You have to realize that “CMS” is a very broad term, and that the approach you take is going to be almost completely dependent on the type of content you’re managing. Care to explain your goals a little?
I don’t know how much you already know about Rails, but I think it will be obvious how to make a CMS once you’ve done 1 little (exercise) application. You just create a page model, possible acts_as_tree, and you assign text and child-pages to parent-pages. Then you create a ui (forms to create new pages, display page) and a user management system and there you have a simple CMS.
Not trying to hijack the thread but I have a question about developing a CMS with Rails and the concept of “pages”. From what I’ve been thinking, I’d have a Page model and a Page controller that would end up producing something like:
Yeah, routes.rb is your best bet. Here’s a sample from the CMS I built:
#maps pages and sections
:controller => 'page',
:action => 'show_page'
#if it's the section only in the URL,
#forward to the index page for that section
:controller => 'page',
:action => 'show_page',
:page_url => 'index'
CMS is a vague term. The time to code one entirely depends on the feature set you require. I could code a CMS in 20 minutes (about) with rails. Create a Category model and have it act_as_tree, create a Page scaffold. Tweak it a bit. Add a catch all route using *url and map it to a show controller. Add a find_by_url method (or whatever the corrent OO name for this kind of function is) to my Page model. Code my show controller which simply takes the URL param from the route, passes it to find_by_url and displays the page. If there is no page, display an error page.
Of course, I don’t think this kind of CMS would be of any use with such little features.
I’m not sure exactly what you are asking, but you might be interested in the catch all routes.
I believe (off the top of my head, so I wouldn’t trust me) that it’s
map.catch_all '*url', :controller => 'foo', :action => 'bar'
and then you can use params[:url] in your bar action in the foo controller., so if you pass domain.com/one/two/what/stuff, your params[:url] will be one/two/what/stuff and you can do whatever with it. You can also have 'whatever/*url'.
Of course, I might be off by a bit (or a lot), but two places to check more about this are the routes unit tests and radiant's source code.