how to add a method without coding it directly into app?
ronald.evangelista
ironald at gmail.com
Thu Jun 5 04:53:53 EDT 2008
..an oversight. :-)
modified slightly to work:
class_def(meth) do |*a|
controller_module = self.class.name.split(/::/)
controller_module.pop
controller_module << :Login # maybe this could be passed as an arg too
controller_module=controller_module.join("::").constantize
@state.Back=@env.REQUEST_URI
return redirect(controller_module) if @state.blank? or
@state.user_id.nil?
send("__#{meth}__", *a)
end
thanks for the speedy reply!
More information about the Camping-list
mailing list