Hi all, Is there an easy way to find out if render :template will find the requested template (before actually attempting to render it) ? Ultimately, I''d like a template hierarchy, with fallback templates, or multiple template location paths. Thanks, Fabien
Hi all, Is there an easy way to find out if render :template will find the requested template (before actually attempting to render it) ? Ultimately, I''d like a template hierarchy, with fallback templates, or multiple template location paths. What about treating the ActionController as a Proxy, delegating Action requests to sub actions (implemented as seperate objects/files) ? Thanks, Fabien
Hi, On 10/27/05, Fabien Franzen <fabien-ybTcI8K1SLc@public.gmane.org> wrote:> Hi all, > > Is there an easy way to find out if render :template will find the > requested template (before actually attempting to render it) ?$ ri File::exist? ----------------------------------------------------------- File::exist? File.exist?(file_name) => true or false File.exists?(file_name) => true or false (obsolete) ------------------------------------------------------------------------ Return +true+ if the named file exists. Cheers, JS> Fabien > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- http://johansorensen.com http://theexciter.com
Hi, That''s one way, yes. It doesn''t actually pay attention to the relative nature of the ''View'' location from a Controller perspective. It seems that template_exists? is available, but somehow it doesn''t check with the correct (module)/action prefixes.> Hi, > > On 10/27/05, Fabien Franzen <fabien-ybTcI8K1SLc@public.gmane.org> wrote: > >> Hi all, >> >> Is there an easy way to find out if render :template will find the >> requested template (before actually attempting to render it) ? >> > > $ ri File::exist? > ----------------------------------------------------------- > File::exist? > File.exist?(file_name) => true or false > File.exists?(file_name) => true or false (obsolete) > ---------------------------------------------------------------------- > -- > Return +true+ if the named file exists. > > Cheers, > JS >