Re: extending controllers

eben
Sun, 30 Sep 2007 17:47:09 -0000

Thanks for the response, that''s what I was hoping was the case.  One
more question:

This code in the "show" Page view works fine

<% for column in Page.content_columns %>

<%= column.human_name %>: <%=h
@page.send(column.name) %>

<% end %>

However if I copy that into the "about" view in the new controller, I
get this error:

undefined method `name'' for #<Array:0xb799d1f0>

Note, I''m using this to fetch the data in the controller: @page
Page.find(:all, :conditions => "name =
''some_page''")

<%= debug(@page) %> shows a valid record returned in the Page object,
so I''m unclear why the for loop would be failing?

thanks,
Eben

On Sep 30, 1:16 pm, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> You don''t need to do anything in particular. The Page model is
> available in the same way from whatever controller or other model
> you''re using.
>
> Fred