Ticket #7086: scaffold_resource_path.diff
| File scaffold_resource_path.diff, 1.7 kB (added by bscofield, 2 years ago) |
|---|
-
scaffold_resource_generator.rb
old new 83 83 end 84 84 85 85 def scaffold_views 86 %w[ index show new edit ]86 %w[ index show new edit _form ] 87 87 end 88 88 89 89 def model_name -
templates/view_edit.rhtml
old new 3 3 <%%= error_messages_for :<%= singular_name %> %> 4 4 5 5 <%% form_for(:<%= singular_name %>, :url => <%= singular_name %>_path(@<%= singular_name %>), :html => { :method => :put }) do |f| %> 6 <% for attribute in attributes -%>6 <%%= render :partial => 'form', :locals => {:f => f} %> 7 7 <p> 8 <b><%= attribute.column.human_name %></b><br />9 <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>10 </p>11 12 <% end -%>13 <p>14 8 <%%= submit_tag "Update" %> 15 9 </p> 16 10 <%% end %> -
templates/view_new.rhtml
old new 3 3 <%%= error_messages_for :<%= singular_name %> %> 4 4 5 5 <%% form_for(:<%= singular_name %>, :url => <%= plural_name %>_path) do |f| %> 6 <% for attribute in attributes -%>6 <%%= render :partial => 'form', :locals => {:f => f} %> 7 7 <p> 8 <b><%= attribute.column.human_name %></b><br />9 <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>10 </p>11 12 <% end -%>13 <p>14 8 <%%= submit_tag "Create" %> 15 9 </p> 16 10 <%% end %>