Rails: find controller for a path no comments

Posted by stephane Sun, 06 Apr 2008 12:20:00 GMT

Huh, seems simple to do :p, but I’ve been seeking for a while to find the answer and dig into rails code to find a simple method to retrieve the controller of a given path (could be useful to build a navigation). There it is:

ActionController::Routing::Routes.recognize_path(path)[:controller]

Ebb, even faster than Thin no comments

Posted by stephane Tue, 04 Mar 2008 21:02:00 GMT

Ebb is new server to put in front of a rackable ruby application.

Have a look to the Ebb website to get some comparison with other app servers.

sudo gem install ebb

What I needed to do before on Mac OS X (leopard with MacPorts):

sudo port install glib2

Model inheritance with Merb no comments

Posted by stephane Thu, 21 Feb 2008 21:16:00 GMT

from help on irc#merb

I had recurrent issue about inherit a model class from another one in Merb, using ActiveRecord or DataMapper. As it’s ‘magicly’ done on Rails I though the same way in Merb, but the last one load model class in alpha order. then what you have to do is to load the first class with a require:

in your first file:

class Page < ActiveRecord::Base
end

then in second add the require:

require 'page'

class ActivePage < Page
end

Simply using ruby…

Most used front end: poll results no comments

Posted by stephane Wed, 20 Feb 2008 12:35:00 GMT

For severals month now I put a poll about which front end people use for their website. Even if it s not a reference with only 85 votes I would like to publsih some result. Of course as the content of this website is ruby oriented, then the results will be also.

First it started with most of votes for apache. At the end Apache it’s still the first:

  • 47%: apache
  • 40%: nginx
  • 7% : lighttpd
  • 5% : others

The result for nginx is over general real stats but for the trend is here and nginx is more and more the choice for a ruby stack as I did present in my last post

Older posts: 1 2 3 ... 5