trying to build an archive page in the controller layout file, i render_component(:action => "archive"), and that works fine. i turned render(:layout => false) within the "archive" function. trouble is, and here's my confusion. as a test, i simply write def archive render(:layout => false) @archives = 'test' end and in the archive.rhtml <%= @archives %> but i get nothing? shouldn't i be able to access @archives?
on 2006-02-05 23:56
on 2006-02-06 00:05
matthew collins wrote: > @archives = 'test' > email@example.com > http://lists.rubyonrails.org/mailman/listinfo/rails > Your archive method should be something like: def archive @archives = 'test' render(:layout => false) end Call render on the last line, because it prepare view to be viewed! -- Husein C., Software Architect
on 2006-02-06 03:42
Try flipping those two statements... If you render before you set the @archives variable, I wouldn't imagine it would be available in the view.