Created
November 15, 2014 12:12
-
-
Save Fivell/81921da21f3d92dc0d22 to your computer and use it in GitHub Desktop.
AA Base decorator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseDecorator < Draper::Decorator | |
| delegate_all | |
| include Rails.application.routes.url_helpers | |
| def arbre(&block) | |
| Arbre::Context.new({}, self, &block).to_s #<<<--pass self as second argument | |
| end | |
| def comments_count | |
| ActiveAdmin::Comment.where(resource_id: self.model.id.to_s, resource_type: self.model.class.to_s).count | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cpfather, did you try to include ActionView::Helpers::NumberHelper