search for: view_path_removes

Displaying 1 result from an estimated 1 matches for "view_path_removes".

2007 Aug 18
0
Tests for render when changing view_paths
...paths that a partial could be in, updates the view_paths for the controller doing the initial rendering, does the rendering, then removes the paths at the end. Here''s the code: module ApplicationHelper def render_partial_with_alternate_view_paths(view_paths, options = {}) view_path_removes = view_paths.inject([]){ |rp, path| self.view_paths.include?(path) ? rp : rp.push(path) } self.view_paths = self.view_paths + view_path_removes returning render( options ) do self.view_paths = self.view_paths - view_path_removes end end end I''ve tried writing sp...