Skip to content

Instantly share code, notes, and snippets.

@cpfarher
Created September 2, 2015 14:31
Show Gist options
  • Save cpfarher/d96cdb0c4de617237c7e to your computer and use it in GitHub Desktop.
Save cpfarher/d96cdb0c4de617237c7e to your computer and use it in GitHub Desktop.
class RecipeDecorator < Draper::Decorator
delegate_all
include Rails.application.routes.url_helpers
def arbre(&block)
binding.pry
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
def parametros_proceso_horno
arbre do
ul do
li number_to_human temp_min_alimentacion
li temp_min_salida
li tiempo_cocinado_minutos
li limite_critico_temp_interna_producto
end
end
end
def limites_operativos_horno
arbre do
ul do
li limite_temp_interna_prod_salida_horno
end
end
end
def parametros_proceso_girofreezer
arbre do
ul do
li tiempo_congelado_minutos_min
li tiempo_congelado_minutos_max
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment