Skip to content

Commit

Permalink
Using the model_* variants of the singular_name/plural_name helpers i…
Browse files Browse the repository at this point in the history
…n the HAML views so the generated titles will use the real model name and not the generic "Resource"/"Resources" labels we get when configured to use Inherited Resources.
  • Loading branch information
Frederic BLANC committed Feb 9, 2010
1 parent 6481054 commit e74f043
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions generators/dry_scaffold/templates/views/haml/edit.html.haml
@@ -1,5 +1,5 @@
%h1.heading
= "Editing <%= singular_name %> %s" % <%= resource_instance %>.id
= "Editing <%= model_singular_name %> %s" % <%= resource_instance %>.id

<% if options[:formtastic] -%>
- semantic_form_for(<%= resource_instance %>) do |form|
Expand All @@ -15,4 +15,4 @@
<% end -%>

%p.actions
= link_to 'Cancel', <%= index_path %>
= link_to 'Cancel', <%= index_path %>
6 changes: 3 additions & 3 deletions generators/dry_scaffold/templates/views/haml/index.html.haml
@@ -1,8 +1,8 @@
%h1.heading
= "<%= plural_name.humanize %>"
= "<%= model_plural_name.humanize %>"

%p.actions
= link_to 'New <%= singular_name.humanize %>', <%= new_path %>
= link_to 'New <%= model_singular_name.humanize %>', <%= new_path %>

%table
%thead.header
Expand All @@ -17,4 +17,4 @@

<% if options[:pagination] -%>
= will_paginate(<%= collection_instance %>)
<% end -%>
<% end -%>
4 changes: 2 additions & 2 deletions generators/dry_scaffold/templates/views/haml/new.html.haml
@@ -1,5 +1,5 @@
%h1.heading
= 'New <%= singular_name.humanize %>'
= 'New <%= model_singular_name.humanize %>'

<% if options[:formtastic] -%>
- semantic_form_for(<%= resource_instance %>) do |form|
Expand All @@ -15,4 +15,4 @@
<% end -%>

%p.actions
= link_to 'Cancel', <%= index_path %>
= link_to 'Cancel', <%= index_path %>
4 changes: 2 additions & 2 deletions generators/dry_scaffold/templates/views/haml/show.html.haml
@@ -1,5 +1,5 @@
%h1.heading
= "<%= singular_name.humanize %> %s" % <%= resource_instance %>.id
= "<%= model_singular_name.humanize %> %s" % <%= resource_instance %>.id

- content_tag_for(:dl, <%= resource_instance %>) do
<% attributes.each do |attribute| -%>
Expand All @@ -10,4 +10,4 @@
%p.actions
= link_to 'Edit', <%= edit_path %>
|
= link_to 'Index', <%= index_path %>
= link_to 'Index', <%= index_path %>

0 comments on commit e74f043

Please sign in to comment.