[Radiant] Flash in a tag module

2007-04-23 Thread Matthew Beale
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 = '' if flash[:erro

Re: [Radiant] Flash in a tag module

2007-04-23 Thread Sean Cribbs
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 resp

Re: [Radiant] Flash in a tag module

2007-04-23 Thread John W. Long
Sean Cribbs wrote: > 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

Re: [Radiant] Flash in a tag module

2007-04-24 Thread Matthew Beale
On Mon, 2007-04-23 at 22:44 -0400, John W. Long wrote: > Sean Cribbs wrote: > > 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 oth

Re: [Radiant] Flash in a tag module

2007-04-24 Thread Matthew Beale
On Mon, 2007-04-23 at 21:00 -0500, Sean Cribbs wrote: > 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 pro

Re: [Radiant] Flash in a tag module

2007-04-24 Thread Sean Cribbs
> Then in the tag: > > request.params[:error] > > Only issue is rails doesn't put the GET params into the request.params > object, it only puts them in the params object, which isn't accessible > from the tag. > > Try request.parameters[:error]. params is a shorthand introduced in ActionCont

Re: [Radiant] Flash in a tag module

2007-04-24 Thread Matthew Beale
On Tue, 2007-04-24 at 09:50 -0500, Sean Cribbs wrote: > > Then in the tag: > > > > request.params[:error] > > > > Only issue is rails doesn't put the GET params into the request.params > > object, it only puts them in the params object, which isn't accessible > > from the tag. > > > > > Try req

Re: [Radiant] Flash in a tag module

2007-04-24 Thread Ryan Heneise
What if you set a local variable in the Page model? You could use an attr_accessor method called Page#flash. Or, you could use a cattr_accessor and define some flash methods like this: class Page < ... cattr_accessor :flash def self.flash=(message) @@flash = {} @@flash[:messa