Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/generators/haml/scaffold/templates/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<% if Rails::VERSION::MAJOR >= 5 && Rails::VERSION::MINOR >= 1 -%>
= form_with model: @<%= singular_table_name %>, local: true do |f|
<% else -%>
= form_for @<%= singular_table_name %> do |f|
<% end -%>
- if @<%= singular_table_name %>.errors.any?
#error_explanation
%h2= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
Expand Down