Hi Anthony ,

Thanks for reply, its good to know that exception handling in rails is
done like this.

thanks

Rahul

On Apr 10, 2:05 pm, Rahul Mehta <[email protected]> wrote:
> 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 <[email protected]>
> 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 <[email protected]> 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 [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<rubyonrails-talk%[email protected]>
> > > .
> > > 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to