Sha256: 198ccfaed7f602087b1c367b7cb9072ade710aa242ebe90920c301243c1abbdb

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

<% @model.form_attributes.each do |entries| %>
<% entries.each do |attribute, properties| %>
		<% if properties["type"] != "adminpanel_file_field" &&
		properties["type"] != "wysiwyg_field" %>
		<% type = properties["type"] %>
		<% args = properties.except("type", "name") %>
	    <%= f.send(type, attribute, args) %>
	<% elsif properties["type"] == "adminpanel_file_field" %>
		<%= f.fields_for :images do |builder| %>
        	<%= render 'shared/image_fields', :f => builder, :model_name => @model.display_name.capitalize %>
    	<% end -%>
    	<%= link_to_add_fields t("Add Image"), f, :images, @model.display_name.capitalize %>
    <% else %>
		<% type = properties["type"] %>
		<% args = properties.except("type", "name") %>
		<%= f.hidden_field attribute, :id => "#{attribute}-field", :value => "" %>
		<%= f.send(type, attribute, args) %>
		<%= content_for :scripts do %>
			<script type="text/javascript">
			<%= render "shared/init_editor", :field_var => attribute, :label => properties[:label] %>
			</script>
		<% end %>
    <% end %>
<% end %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adminpanel-1.0.0 app/views/shared/_form_fields.html.erb