Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/generators/haml/scaffold/templates/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= form_for @<%= singular_table_name %> do |f|
= form_for @<%= singular_table_name %><%= plural_table_name == index_helper ? '' : ", url: #{index_helper}_path" %> do |f|
- 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
2 changes: 1 addition & 1 deletion lib/generators/haml/scaffold/templates/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

= render 'form'

= link_to 'Show', @<%= singular_table_name %>
= link_to 'Show', <%= show_helper(type: :path) %>
\|
= link_to 'Back', <%= index_helper %>_path
8 changes: 4 additions & 4 deletions lib/generators/haml/scaffold/templates/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<% for attribute in attributes -%>
%td= <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
%td= link_to 'Show', <%= singular_table_name %>
%td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
%td= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }
%td= link_to 'Show', <%= show_helper(singular_table_name, type: :path) %>
%td= link_to 'Edit', <%= edit_helper(singular_table_name, type: :path) %>
%td= link_to 'Destroy', <%= show_helper(singular_table_name, type: :path) %>, method: :delete, data: { confirm: 'Are you sure?' }

%br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path
= link_to 'New <%= human_name %>', <%= new_helper(type: :path) %>
2 changes: 1 addition & 1 deletion lib/generators/haml/scaffold/templates/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
= @<%= singular_table_name %>.<%= attribute.name %>
<% end -%>

= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
= link_to 'Edit', <%= edit_helper(type: :path) %>
\|
= link_to 'Back', <%= index_helper %>_path