Hi Anthony, <% begin %> <%= render :partial => 'custom' %> <% rescue ActionView::MissingTemplate %> Default <% end %>
why this begin and end are used what is mean by <% rescue ActionView::MissingTemplate %> can you tell me On Apr 10, 11:19 am, Anthony Crumley <anthony.crum...@gmail.com> wrote: > Doug, > > This may actually be worse but it is another way... > > <% begin %> > <%= render :partial => 'custom' %> > <% rescue ActionView::MissingTemplate %> > Default > <% end %> > > Anthony Crumleyhttp://commonthread.com > > On Fri, Apr 9, 2010 at 7:29 PM, doug <ddjol...@gmail.com> wrote: > > Suppose that I want to have a block of default content within a > > template that is replaced with the content of a specific partial only > > if that partial exists. Obviously there is the brute force approach > > of simply rendering the default content unless the relevant partial > > file exists in which case the relevant partial is rendered instead. I > > suspect that there may be a more elegant way to skin this cat. Any > > suggestions? > > > Thanks for any input. > > > ... doug > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-t...@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.