I prefer to use many partials. It makes my code more DRY
Also I use rspec, and when I have to test partial with sub partials I
have a problem.
if I stub render, then my partial will not be rendered. If i do not
stub render it tries to render sub partial (and i don’t need this)
Not very long googling did not bring the answer, so I made very dirty
and IMHO dangerous function
def block_render_except unblocked
def self.set_unblocked partial
@@unblocked = partial
def render_partial(partial_path, object_assigns = nil,
local_assigns = nil) #:nodoc:
if partial_path.to_s == @@unblocked
return " "
render(:partial => “payments/list”)
The question is how sick am I, and is there more pretty solution of my
Also wanted to know how this approach to design view part of
application is right?