lib/trestle/admin/builder.rb in trestle-0.8.12 vs lib/trestle/admin/builder.rb in trestle-0.8.13
- old
+ new
@@ -54,10 +54,14 @@
def form(options={}, &block)
admin.form = Form.new(options, &block)
end
+ def hook(name, options={}, &block)
+ admin.hooks.append(name, options, &block)
+ end
+
def admin(&block)
@admin.instance_eval(&block) if block_given?
@admin
end
@@ -65,10 +69,10 @@
@controller.class_eval(&block) if block_given?
@controller
end
def routes(&block)
- @admin.additional_routes = block
+ @admin.additional_routes << block
end
def breadcrumb(label=nil, path=nil, &block)
if block_given?
@admin.breadcrumb = block