Sha256: 45f25991d5b39e2bb65086e38928cc3b6d662b5d82a7d2596d7ab131e7d205af

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

<#if errors??>
	<#list errors as error>
		 ${error.category} - ${error.message}<br />
	</#list>
</#if>

<form action="<%= path %>" method="post">
  
  <#if <%= "#{model_parameter_name}.id" %>??>
    <input type="hidden" name="<%= "#{model_parameter_name}.id" %>" value="<%= "${#{model_parameter_name}.id}" %>"/>
    <input type="hidden" name="_method" value="put"/>
  </#if>

<% @attributes.each do |att| -%>
  <div class="field">
    <%= att.html_label %>:<br />
		<%- if att.type.eql?("references") -%>
    <select name="<%= model_parameter_name %>.<%=att.name%>.id">
	  	<#list <%=att.name%>List as <%=att.name%>>
				<option value="${<%=att.name%>.id}" <#if <%= model_parameter_name %>.<%=att.name%>?? && <%= model_parameter_name %>.<%=att.name%>.id <%= "== #{att.name}"%>.id>selected="true"</#if> >${<%=att.name%>.id}</option>
	  	</#list>
    </select>
		<%- else -%>	
    <%= "<@html.#{att.html_input} \"#{model_parameter_name}.#{att.name}\" #{model_parameter_name}.#{att.name}/>"  %>
		<%- end -%>
  </div>
<% end -%>
  <div class="actions">
    <button type="submit">send</button>
  </div>
</form>

<a href="<%= path %>">Back</a>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vraptor-scaffold-1.3.0 lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/templates/form.erb