<?xml version=“1.0” ?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> <html xmlns=“www.w3.org/1999/xhtml”>
<head> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="expires" content="-1" /> <%= css '/css/jquery.mobile.css' %> <%= js_for '/js/jquery.js', '/js/jquery.mobile.js' %> </head> <body > <div data-role="page" id="top"> <div data-role="header"> <a href="<%= r(@model_name) %>" data-role="button" data-icon="back" data-ajax="false" data-direction="reverse">List</a> <h1><%= h @model_name.camel_case %> Edit</h1> </div> <div data-role="content"> <form action="<%= r(:edit, @model_name, @resource.id) %>" method="post" id="form" name="form" data-ajax="false"> <% @resource.class.properties.each do |property| %> <p style="color: #FF0000;"> <%= @resource.errors[property.name].join(',') %> </p> <p> <label for="<%= property.name %>"> <%= h property.name %> </label> <% if property.kind_of?(DataMapper::Property::Text) %> <textarea name="<%= property.name %>" id="<%= property.name %>"><%= @resource[property.name] %></textarea> <% else %> <input type="text" name="<%= property.name %>" id="<%= property.name %>" value="<%= @resource[property.name] %>"> </input> <% end %> </p> <% end unless @resource.nil? %> </form> </div> <div id="footer" data-role="footer" class="ui-bar" data-position="fixed" data-id="persist"> <a href="#" data-role="button" data-icon="forward" data-ajax="false" onclick="$('#form').submit(); return false;">Update</a> <a href="<%= r(:destroy, @model_name, @resource.id, 'confirm') %>" data-rel="dialog" data-transition="pop" data-role="button" data-icon="delete">Destroy</a> </div> </div> </body>
</html>