This project is archived and is in readonly mode.
ActionView::PathSet .exists? fails due to nil array
-
Tanel Suurhans
Probably needs a bit more information to write a failing test-case. The fix in itself looks easy enough.
-
Mario Olivio Flores
You could submit any value to
view_paths.exists?and it will fail.Here is my example. I am using a pages_controller, to manage my static pages. Before attempting to load a template, I want my app to ensure the template exists, using a before filter.
class PagesController < ApplicationController unloadable before_filter :ensure_valid def show render :template => current_page end protected def ensure_valid unless view_paths.exists?(current_page) render :nothing => true, :status => 404 and return false end end def current_page "pages/#{params[:id].to_s.downcase}" end end