myexperiment-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Myexperiment-discuss] Include template file


From: Jiten Bhagat
Subject: Re: [Myexperiment-discuss] Include template file
Date: Thu, 06 Nov 2008 08:02:04 +0000
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Hi Tony,

You need to use partials, so something like:

<div id="skuaTemplate" style="display:none">
<%= render :partial => "skua/claim_form", :locals => { :local_data_passed_in => "my data", :more_local_data => "some more data" } %>
</div>

This will then look for the following partial file;

/app/views/skua/_claim_form.rhtml

... which will have the contents you mention below.

Hope that helps.

Jits



Linde, A.E. wrote:
Hi all, in app/views/workflows/index.rhtml I am including a template which, when clicking the link I’ve added alongside each displayed workflow, gets loaded with workflow details in a shadowbox and displayed to the user to enable them to post a SKUA claim. In index.rhtml I have got:

<div id="skuaTemplate" style="display:none"> <div style="font-family:Verdana;"> <div style="padding-bottom:10px;"></div> <form id="frmClaim" style="font-size:9pt;" method="POST" action="/proxy"> <div style="padding-bottom:7px;"> <div style="padding-bottom:3px;"> <label style="margin-left:10px; float:left; width:80px;">Object type:</label> <input id="txtType" style="margin-left:3px; width:90px" type="text" value="#{objectType}" disabled /> <label style="margin-left:10px;">Title:</label> <input id="txtTitle" style="margin-left:3px; width:350px" type="text" value="#{title}" disabled /> ... </form> </div> </div> In all, 70 lines, which seems to unbalance the file and be against the whole rails approach: is there a command I can stick between the first <div> and last </div> which would just pull in the contents of a file (stored, say, in /app/public/templates)? eg:

<div id="skuaTemplate" style="display:none">
#include templates/workflow.tmpl
</div>

Thanks,
Tony.

--
Tony Linde
Project Manager
Department of Physics & Astronomy
University of Leicester
------------------------------------------------------------------------

_______________________________________________
Myexperiment-discuss mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/myexperiment-discuss





reply via email to

[Prev in Thread] Current Thread [Next in Thread]