Sha256: ef0dba4093890c666a31758079a93d54d607f472d063a73863d99801dd34554b
Contents?: true
Size: 1.62 KB
Versions: 6
Compression:
Stored size: 1.62 KB
Contents
<form name="new<%= @model_name%>"> <fieldset> <legend> New <%= @model_name.titleize %> </legend> <%- columns.each do |column| -%> <div class="control-group"> <label class="control-label"> <%= column.name.titleize %> </label> <div class="controls"> <%- if ['description', 'body'].include? column.name -%> <textarea name="<%= @resource_name%>[<%= column.name %>]" ng-model="<%= @resource_name%>.<%= column.name %>" class="<%= column.field_type %>" required></textarea> <%- else -%> <input type="<%= column.field_type.to_s.split('_').first %>" name="<%= @resource_name%>[<%= column.name %>]" ng-model="<%= @resource_name%>.<%= column.name %>" class="<%= column.field_type %>" required> <%- end -%> <span ng-show="new<%= @model_name%>.<%= column.name %>.$error.required" class="help-inline"> Required </span> </div> </div> <%- end -%> <div class="form-actions"> <button class="btn btn-success" ng-click="save()" ng-disabled="isClean() || new<%= @model_name%>.$invalid"> <i class="icon-save"></i> Save </button> <button ng-click="destroy()" ng-show="<%= @resource_name%>.id" class="btn btn-danger"> <i class="icon-trash"></i> Delete </button> <a href="/<%= @plural_model_name%>" class="btn">Back to <%= @plural_model_name%></a> </div> </fieldset> </form>
Version data entries
6 entries across 6 versions & 3 rubygems