12th Sun
MerbでBumbleを使うポイント
Bumble
はGoogle App Engine for JavaのDateSoreを利用するためのライブラリですが、Railsで利用する前提で作られているので、
Merbで利用する場合には、以下のような修正を加えると良いようです。
bumble.rb
ruby>>
module Bumble
(..snip..)
def self.included(base)
base.send :include, InstanceMethods
base.send :extend, ClassMethods
Merb::Router.root_behavior =
Merb::Router.root_behavior.identify(Bumble => :key)
end
<<--
これによって、resource(@person) #=> /people/5 のようにidentifyしてくれるようになります。
posted by
genki on Sun 12 Apr 2009 at 02:19 with 0 comments