Revisions of #313
Contributors: Dennis Hackethal
Hiccdown methods should live in their own, separate modules. How about they are called ‘renderers’?
module ProductsRendererdef self.index vc, # …vc.some_helper_methodendend
↓
Hiccdown methods should live in their own, separate modules. How about they are called ‘renderers’?
module ProductsRendererdef self.index vc, # …vc.some_helper_methodendend
Hiccdown methods should live in their own, separate modules. How about they are called ‘renderers’?
module ProductsRendererdef self.index vc, # …vc.some_helper_methodendend
A benefit of this approach is that, when people start a new Rails app, they may end up putting whatever they’d otherwise put in a helper in a renderer, since renderers have the benefit of having unambiguously resolvable method names.
↓
Hiccdown methods should live in their own, separate modules. How about they are called ‘renderers’?
module ProductsRendererdef self.index vc, # …vc.some_helper_methodendend
A benefit of this approach is that, when people start a new Rails app, they may end up putting whatever they’d otherwise put in a helper in a renderer, since renderers have the benefit of having unambiguously resolvable method names.
Hiccdown methods should live in their own, separate modules. How about they are called ‘displays’?
module ProductsDisplaydef self.index vc, # …vc.some_helper_methodendend
A benefit of this approach is that, when people start a new Rails app, they may end up putting whatever they’d otherwise put in a helper in a display, since displays have the benefit of having unambiguously resolvable method names.
↓
Hiccdown methods should live in their own, separate modules. How about they are called ‘displays’?
module ProductsDisplaydef self.index vc, # …vc.some_helper_methodendend
A benefit of this approach is that, when people start a new Rails app, they may end up putting whatever they’d otherwise put in a helper in a display, since displays have the benefit of having unambiguously resolvable method names.
Hiccdown methods should live in their own, separate classes. How about they are called ‘displays’?
class ProductsDisplaydef index vc, # …vc.some_helper_methodendend
Behind the scenes, the Hiccdown gem would need to make the instance variables available to the display class:
display = @display_module.newview_context.instance_variables.each do |iv|display.instance_variable_set(iv,view_context.instance_variable_get(iv))end
Then:
class ProductsDisplaydef index vc, # …vc.some_helper_method(@products)endend
↓
Hiccdown methods should live in their own, separate classes. How about they are called ‘displays’?
class ProductsDisplaydef index vc, # …vc.some_helper_methodendend
Behind the scenes, the Hiccdown gem would need to make the instance variables available to the display class:
display = @display_module.newview_context.instance_variables.each do |iv|display.instance_variable_set(iv,view_context.instance_variable_get(iv))end
Then:
class ProductsDisplaydef index vc, # …vc.some_helper_method(@products)endend
Hiccdown methods should live in their own, separate classes. How about they are called ‘displays’?
class ProductsDisplaydef index vc, # …vc.some_helper_methodendend
Behind the scenes, the Hiccdown gem would need to make the instance variables available to the display class:
display = @display_module.newview_context.instance_variables.each do |iv|display.instance_variable_set(iv,view_context.instance_variable_get(iv))end
Then:
class ProductsDisplaydef index vc, # …vc.some_helper_method(@products)endend