Drupal and Ruby on Rails

Because I'm a fan of both Ruby on Rails and Drupal (yes, Drupal uses PHP), I get a surprising number of visits to my website each day from Google searches that include some combination of the two as keywords. I find this strange because if you know either of the two, you know that they're in two totally separate worlds.

Drupal doesn't expose any kind of API (besides RSS feeds) that Rails could take advantage of, nor does it make sense to create one.

Since Drupal uses PHP, you can't create module for it in Rails. The only way I could possibly think to marry the two would be to create a module that simply puts an iframe on the page and loads it with your Rails app. In fact, it doesn't even have to be a module. It could be a simple page you create with an iframe pointing to your Rails app.

But why in the hell would anyone want to do this? I guess I'm a little short sighted on this issue right now as its hard to see where the two would play nicely with each other, or why you would want them to. If you want to extend Drupal, use PHP. If you want to use Rails, look at Mephisto or Radiant CMS and extend either of those.

This could just be a case of people not fully understanding what the two are. For those people, Drupal is a CMS written in PHP. Ruby on Rails is a web framework that allows you to easily create web applications. I could see how some people might also think of Drupal as a framework to base a web application off, but again, if you're going to start with Drupal, you will need to know PHP to modify it.

Am I missing something here?

Comments

Connecting Technologies

Few months ago, we connected Joomla and Ruby on Rails.
We were in need of a banner system. Joomla have a fairly good one, AdBannerPlus and developping one in Ruby on Rails is still a good work to do.

I tricked the Joomla CMS to present only banner ads. I changed the template and on the RoR site, I load from an internal callback to the Joomla system.

Simple, efficient and transparent. It's not because you have an hammer in your hand that everything look like a nail. You have to adapt an leverage the technologies around you.

Have a good day.

Ruby and Drupal

What a great piece of flypaper! I, too, googled Drupal and Ruby, and landed here. I'm guessing that my goal is the same as that of many other searchers--finding a CMS with many of Drupal's terrific features, but implemented in Ruby.

The reasons for looking for a Ruby-based implementation include:

  • Capability: Ruby is powerful, and applications written in it can be extended in interesting ways, including adding to existing classes without rewriting them, and construction of useful domain-languages to solve domain-specific problems.
     
  • Familiarity: It takes a lot of time to learn a language and become seriously proficient at it. Ruby is pretty unique in that it can be used for day-to-day scripting and for serious applications. That makes it reasonable to think of it as possibly the "one language to bind them all", so you can spend your time getting seriously proficient in one language, rather than acquiring a surface familiarity with many. (Each has its own rewards, but real mastery lets you do so much more.)
     
  • Confidence: Any extensions you want to make will most likely require extensive refactoring. Otherwise, they probably would already be implemented. Given the nearly-inevitable desire to something of that kind, one day, it makes sense to look for an implementation that is written in a language you are familiar with, which you know to be powerful enough to do anything you might ever want to do, so can undertake the task with confidence.

      Hopefully, that helps to explain why folks keep finding your page after a search. (I'm grateful for the pointers to Mephisto and Radiant CMS. Apparently, they are somewhat equivalent to Drupal, so they're worth a strong look. In return, I felt I owed you a semi-choherent explanation!)
      :_)

Agreed

I agree with you on Ruby's power via its extensibility and flexibility. The natural syntax of Ruby lends itself to becoming that one language you can learn and do everything with.

The only reason there isn't an equivalent of Drupal in Ruby at this point is because of the maturity and popularity of the PHP language compared with Ruby and Rails. Given time, we will eventually see one of the Rails CMS's rise to the level of adoption as Drupal. (Although I admit that predicting the future of technology is pointless.)

I also failed to mention RailFrog as another alternative Rails CMS to Drupal. It has been in development for sometime, but I think Mephisto and Radiant are still the front runners.

Drupal on Rails ?

For me, an implementation of Drupal in Ruby using the Rails framework makes perfect sense. What people like most about Drupal is the easy installation and the wonderful availability of off the shelf modules that allow for quick customization to the type of site you are trying to build. While Radiant CMS and Mephisto are quite good at what they do (simple blogs, community web sites, etc) for those that are trying to build much more involved sites that might include, for instance, eCommerce components, photo galleries, tag clouds, social networking elements, etc, the availability of modules is key.

I think an implementation of Drupal in Rails would allow for the creation of those off the shelf modules much more quickly. Another thing to consider is that it opens up the Drupal experience to not only the platforms that can run Rails, but also to Java shops where it can now be successfully deployed using JRuby. I think the same developer community that brought us so many great Drupal modules and themes over the years can be brought to life in the Rails community as well and possibly even quicker given the bonus that Rails offers much better facilities for tests. With the ability to have tests for each module, quality can only improve and regression testing of your site when a new module is introduced into the site would be a no brainer.

I've been looking for a good challenge. I may take this on myself :--)

Why I'm here

I landed on your site searching for Drupal and Rails. The reasons:
1) I admire Drupal for it's flexibility, stability, extensibility, community, deployments, etc.
2) I refuse to develop anything in PHP. It->makes->me->shiver.
3) I'd love to have a a quality CMS to build off of in Rails rather than the daunting task of implementing everything myself.

The answer appears to be at least a year off, but thanks for referring me to the front-runners. The mission of my Google search is accomplished.

Ruby and Drupal

Like the rest of you I googled Ruby and Drupal and got here.

Drupal has paid off for me because I can get a lot done quickly with it. But it doesn't do CRUD well, which is where Ruby On Rails comes in.

But what I am really interested in is in using Drupal as it stands together with a bespoke RoR application (made by me).

I would use CSS to make the HTML from each site look the same and then some Apache magic to make them both look like they were being served out from very nearly the same URL.

This would seem to meet the DRY criteria better than attempting to rewrite Drupal (!!!!!!) in Ruby.

What do you think? Am I missing something? Authentication/authorisation perhaps.

RoR embedded in Drupal

Hmmmm. What i want is slightly different I guess:

I want to leverage the all the goodies Drupal brings with a new app I want to build in RoR.

I want to use Drupal as is (not re-develop it in RoR), but have my RoR app fully integrated with it. Essentially, I have workgroups that all need to use the same app, and I want to have authentication, access controls, modularity (blocks and nodes on drupal-speak) be populated by my RoR app. Why implement notes in my app when Drupal has blogs? Why implement photo attachments in my app when Gallery integrates with drupal already?

I don't want to develop the app as a stand-alone, or as a php Drupal module, since I can do it so much more easil and quickly on RoR.

In Rails building is easier, but in Drupal you might not have to

I'm mostly looking for a platform for doing highly customizable CMS solutions. Drupal seems to provide this, and it seems like oftentimes people don't even need to touch PHP code. In Rails again touching the code seems like a lot of fun, but with a tight schedule, you might not have time to reinvent the wheel... thus Rails comes in when Drupal's flexibility isn't enough, which usually means web apps that anyways need to be made from scratch.

Correct me if I'm making the wrong assumptions... ;-)

Drupal

Actually, drupal is the best cms out there.

Drupal powered with RoR

I've browsed here via google because i was looking for how to power up drupal with RoR, if that is possible and is not the pain to do so. I am thinking of using Drupal for all content management and power it up with RoR. Does anyone know for any good example of such website or some tutorials perhaps?

The answers in the comment

I guess the responses vary for the reasons of searching Drupal and Ruby. Developers are looking to coagulate the usage and functionalities shared between the two or make comparisons. I guess this post has assisted as it is allowing those searching to make it clearer.

There are many joomla 1.5 tutorial articles available out there that are comparing Joomla to other CMS and a lot of searches are for 'joomla wordpress' the common reason is converting Joomla into a blog or a wordpress into more functioning CMS

Possible Solution

I use Drupal and RoR almost exclusively at work and have always been interested in marrying the two. I think a possible solution would be a simple module that just "proxies" to RoR, kind of like how Apache proxies to mongrel. For example, you could set up a drupal "proxy" node with the path "myrailsapp". The module would handle requests for "myrailsapp/some/args" and just use "file_get_contents()" to pull from a rails app running on localhost. I.e., file_get_contents('http://localhost:3000/myrailsapp/some/args');.

It's also pretty easy to have RoR models use Drupal's tables, even if they live in another database via something like:

class DUser < ActiveRecord::Base
table_name 'drupal_db.users'
end

Thought I'd post my ideas here in case someone wants to do this before I get around to it :)

Clueless

I got here from that same Google search. I don't know much at all about what any of you are talking about. But I have a cousin who is about to drop a bunch of money into having a Joomla-based website built for her and my talent is to be able to do some research in a field I'm only slightly familiar with and come up with a pretty good picture of what works and what doesn't.

There's a lot in the comments above that I don't understand, but the gist of it speaks volumes.

Thanks.

Have you looked at the Drupal Services module?

Take a look at http://drupal.org/project/services . To quote the page:

A standardized solution of integrating external applications with Drupal. Service callbacks may be used with multiple interfaces like XMLRPC, SOAP, REST, AMF. This allows a Drupal site to provide web services via multiple interfaces while using the same callback code.

Also, Drupal sites can easily use SOAP or RESTful services to either go get content to display, or to interact with external systems (e.g. payment gateways, etc.)

So, why wouldn't a solution be to either:

  • Have Ruby / RoR be the main engine of your site, but use the Drupal Services module to take care of things like users / roles / .... (BTW - this is how the Adobe Flex showcase site works.)
  • Use Drupal as the main engine of your site, but if you have some service you want to write in Ruby, just expose it via XMLRPC, then have Drupal consume that service in the process of building a page, or whatever...

-jb

I'm a user of rails and

I'm a user of rails and drupal (1.x and 2.x of rails, 4.x, 5.x, 6.x, and 7.x of drupal).

Drupal is awesome as a content repository. If you need to do anything beyond that - like add behavior or workflow, you need rails. Business rules? You need Rails or something in Java.

You can build a CMS in rails customized to exactly what you need, with one novice programmer, in about the same time it takes to !configure! a drupal cms to do anything crazy. The big thing I've found is that drupal rocks for static content. Rails can't touch drupal if all you're dealing with is static content (give it < 12 months, and there should be a rails CMS that blows drupal away. Add a single business rule to what you want the site to do, then you're scratching your head while attempting to piecemeal 247 modules together to *almost* do what you need it to do.

Use rails then drupal, and you'll wonder why you can't just do:
if article.length.is_longer_than article.box.size do
email article.author(:special_invitation_email) unless user.friends.logged_in?.size > 0
end

Yes. It reads in english the same as in code.

Biggest downside of rails? It doesn't have the enormously well organzied and enthusiasticaly helpful drupal community. Second biggest downsize? Rails moves so fast that you can't use it unless you want to relearn it ever year. It's so much in it's infancy that every six months, there are major changes and major shifts in what is cool and what is not.

I asked why not both for a long time. I spent a long time trying to make drupal do things that it was never meant to do. If you are building a newspaper, use drupal. If you're building a social network, use rails.

Joomla vs Drupal vs Rails

I don't know anyone that would use Joomla over drupal.

OpenKH is Drupal on

OpenKH is Drupal on Rails.................................!

This is Big design.

have you check this

Yeah, Web Services

When I've read this article, one option of interation came to my mind: Web Services.

Maybe not exactly rails, but you can use some RESTful MVC Framework implementing the Active Record pattern to write some crud stuff to deal with data that don't need to be node/field, or maybe encapsulate and serve as CRUD gateway to one or more legacy app databases, so one or more Drupal site(s) can consume this data.

Question for Josh Huckabee, the owner of this site

Hi Josh,

This site is running Drupal 6. Why not Rails?

gd

Path of least resistance

@good.dictus: Drupal has everything I need in terms of blogging/CMS and I can host it worry-free on minimal resources.

As I stated in my article, I'm a fan of both and I think they both have their uses. For a simple blog, Drupal does what I need with the least hassle - although with phusion they might be equally stable in terms of hosting now.

Drupal versus Ruby

I new to this world and would like to learn one. Am just exploring which is best for my needs: ColdFusion, Joomla/Drupal (php solutions) or RonR.

ColdFusion gets high marks, but is mighty expensive.

Seems like the PHP solution, Joomla & Drupal are very popular, but I hear a lot of people complaining about how bad a languege PHP is.

Ruby is suppose to be nicer, but there is a lot less info on RonR and I gather you can create as fast with Ruby as you can load in Drupal modules.

Steve

Interesting

Mayobutter,

An interesting approach. Keep us posted on how you far.

- gareth

As I approach my project,

As I approach my project, which has portal and networking functions, I'm not quite sure whether to implement Drupal, Rails or Drupal with Rails. Of course it depends on specifics, but that's my point and Ben Kessels too. They both have advantages, why not elaborate on the strengths and weakness, where one is totally unique, where another is weak.

Has anyone gone beyond the religion from either camp to come up with an "objective" or tabled evaluation?

poker math

Kudos on the web services.

Kudos on the web services. Like to integrate the two so Drupal handles the marketing/front web site, and RoR handles the more complex functionality.

My main concern would be to perform Single Sign In and to allow RoR to access Drupal's content data.

I'm a RoR expert and Drupal newbie, so any further comments on cross integration would be appreciated.

--Jay

Community Engine?

Anyone here used Community Engine? It's a rails-based Social Networking platform. I'd like to build a multi-user social networking platform similar to Ning and WPMU - just not sure what software platform to use. And I'd prefer to use Rails if at all possible.