Hi All,
I have some ERB .rhtml templates in my rails CMS app. The user selects
a template for each page through the CMS administration UI. So the list
of available templates is presented in a drop-down.
I don''t want to create a ''template'' model which sits
in my DB as it is
overkill. What I want to do is somehow define meta data about each
template (namely a title and description) as some class variables
inside the ERB .rhtml templates such as:
<%
require ''registerable_asset''
include RegisterableAsset
register ''Name of Template''
description ''This template is a default template''
%>
<html>
... rest of template ...
</html>
So I''ve created a module (registerable_asset) which appends these
features as class variables and tried to include this in the template
file using the standard (include ...), but I get an error:
undefined method `include'' for
#<#<Class:0x256a8dc>:0x256a8b4>
I assume that I am putting the ''include'' statement in the
wrong place
but I''m not sure where to put it. Does anyone have any suggestions?
Many Thanks
Mark Dodwell
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---