app/helpers/trestle/url_helper.rb in trestle-0.8.2 vs app/helpers/trestle/url_helper.rb in trestle-0.8.3
- old
+ new
@@ -11,17 +11,18 @@
else
admin = admin_for(instance) || self.admin
end
if admin
- link_to(content, admin_url_for(instance, admin), options)
+ link_to(content, admin_url_for(instance, admin: admin), options)
else
content
end
end
- def admin_url_for(instance, admin=self.admin)
- admin.path(:show, id: admin.to_param(instance)) if admin
+ def admin_url_for(instance, options={})
+ admin = Trestle.lookup(options[:admin] || self.admin)
+ admin.path(options[:action] || :show, id: admin.to_param(instance)) if admin
end
def admin_for(instance)
Trestle.admins[instance.class.name.underscore.pluralize]
end