Displaying 1 result from an estimated 1 matches for "orig_render_partial".
2008 May 08
0
stub sub partials when testing partial with rspec
...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
ActionView::Partials.class_eval do
public
def self.set_unblocked partial
@@unblocked = partial
end
alias_method :orig_render_partial,:render_partial
def render_partial(partial_path, object_assigns = nil,
local_assigns = nil) #:nodoc:
if partial_path.to_s == @@unblocked
orig_render_partial(partial_path, object_assigns,
local_assigns)
else
return " "
end
end
en...