Wisdom Of Og
(by Kashia) If you don’t want Og to create auto-incremented oid column, use this:
class Blah; attr_accessor :oid, Fixnum, :sql => 'integer primary key'; end
To have many models have the same oid source (postgres adaptor only):
class Blah
attr_accessor :oid, Fixnum, :sql => 'integer primary key', :sequence => 'my_custom_seq'
end
Routes
ann :view_user, :route => [ /user_(\d*)_(*?)\.html/, :id, :mode ]
:view_user is a action in the controller
do this somewhere close to that action :P
the regex is, what url you want to match, the parameters behind that have to match the brackets in the regex.
use (?:) when you don’t want a bracket to be matched.
when you want even more control about the routes, use the Router:
Router.add_rule :match => /rewritten\/url\/(.*)/, :controller => IdController, :action => :register, :param => :name
$1 becomes :name
Router.add_rule :match => %r{another/zelo/(.*)/(.*)}, :controller => AdminController, :action => :kick, :params => [:name, :age]