Skip to content
Browse files

patch cell rendering to use views folder

  • Loading branch information...
1 parent 25e1d5f commit b17ec0890101f9cd1b25bfbfc32c29d8b4010ce2 @kristianmandrup committed Sep 6, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 lib/apotomo.rb
  2. +8 −0 lib/apotomo/cell/rendering.rb
1 lib/apotomo.rb
@@ -22,6 +22,7 @@ def setup
require 'apotomo/widget'
require 'apotomo/railtie'
+require 'apotomo/cell/rendering'
require 'apotomo/widget_shortcuts'
require 'apotomo/rails/controller_methods'
require 'apotomo/javascript_generator'
8 lib/apotomo/cell/rendering.rb
@@ -0,0 +1,8 @@
+module Cell
+ module Rendering
+ def render(*args)
+ view_name = File.join('views', self.action_name)
+ render_view_for(view_name, *args)
+ end
+ end

4 comments on commit b17ec08

kuraga commented on b17ec08 Feb 23, 2013

Have we sense to move this change to Cells?


It was a patch specifically to override the default behavior as defined in cells so that the views are not mixed with the action classes, but can live in a separate views folder "next to" that action class. Another option would be to have a separate views folder at the widgets (root) level like in Rails. Simpy having a views folder with the action class however would make it easier to move refactor and move around the action class with views as one entity. The other (more Rails like) approach would require more "synchronization effort".

kuraga commented on b17ec08 Feb 24, 2013

I mean that this option (in some variant) is good for Cells too... And is it good when Cells and Apotomo behavior is equivalent, isn't it?

Please sign in to comment.
Something went wrong with that request. Please try again.