Permalink
Browse files

patch cell rendering to use views folder

  • Loading branch information...
kristianmandrup committed Sep 6, 2012
1 parent 25e1d5f commit b17ec0890101f9cd1b25bfbfc32c29d8b4010ce2
Showing with 9 additions and 0 deletions.
  1. +1 −0 lib/apotomo.rb
  2. +8 −0 lib/apotomo/cell/rendering.rb
View
@@ -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'
@@ -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
+end

4 comments on commit b17ec08

@kuraga

This comment has been minimized.

Show comment
Hide comment
@kuraga

kuraga Feb 23, 2013

Have we sense to move this change to Cells?

Have we sense to move this change to Cells?

@kristianmandrup

This comment has been minimized.

Show comment
Hide comment
@kristianmandrup

kristianmandrup Feb 24, 2013

Owner

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".

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

This comment has been minimized.

Show comment
Hide comment
@kuraga

kuraga 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?

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?

@kristianmandrup

This comment has been minimized.

Show comment
Hide comment
@kristianmandrup

kristianmandrup Feb 24, 2013

Owner
Please sign in to comment.