Tags exist in the Page model (or a subclass) when processing, so they
really only have access to the model layer. *However*, the Page model
has available to it the request and response objects. There are other
ways to tackle the problem, but you could try getting the information
from the response object. I believe the flash is stored in the session.
if response.session['flash'][:error]
# do something
end
Cheers,
Sean
Matthew Beale wrote:
> Hi all,
>
> I'm doing some work on an extension, and I'm run into an issue. I'd
> like to pass validation errors on a form back to the tag that draws the
> form. ala:
>
> module FormTags
> include Radiant::Taggable
>
> desc %{
> Displays the form
> }
> tag "form" do |tag|
> form = '<form name="form" action="/forms/create">'
> if flash[:error]
> form << '<span class="error">'+flash[:error]+'</span>'
> end
> ...
> end
> end
>
> So, how do I access that? controller.flash doesn't work, and nor does
> flash (or passing a variable through the class scope).
>
> Thanks for any ideas-
>
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant