Skip to content

Commit

Permalink
Add more context to resource generator
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcsmith committed Dec 28, 2019
1 parent e421076 commit ae73017
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class <%= pluralized_resource %>::EditPage < MainLayout
needs operation : <%= operation_class %>
needs <%= underscored_resource %> : <%= resource %>
quick_def page_title, "Edit"
quick_def page_title, "Edit <%= resource %> with id: #{@<%= underscored_resource %>.id}"

def content
h1 "Edit"
link "Back to all <%= pluralized_resource %>", <%= pluralized_resource %>::Index
h1 "Edit <%= resource %> with id: #{@<%= underscored_resource %>.id}"
render_<%= underscored_resource %>_form(@operation)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class <%= pluralized_resource %>::IndexPage < MainLayout
needs <%= pluralized_resource.underscore %> : <%= query_class %>
quick_def page_title, "All"
quick_def page_title, "All <%= pluralized_resource %>"

def content
h1 "All <%= pluralized_resource %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class <%= pluralized_resource %>::NewPage < MainLayout
needs operation : <%= operation_class %>
quick_def page_title, "New"
quick_def page_title, "New <%= pluralized_resource %>"

def content
h1 "New"
h1 "New <%= pluralized_resource %>"
render_<%= underscored_resource %>_form(@operation)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class <%= pluralized_resource %>::ShowPage < MainLayout
needs <%= underscored_resource %> : <%= resource %>
quick_def page_title, @<%= underscored_resource %>.<%= columns.first.name %>
quick_def page_title, "<%= resource %> with id: #{@<%= underscored_resource %>.id}"

def content
link "Back to all <%= pluralized_resource %>", <%= pluralized_resource %>::Index
h1 @<%= underscored_resource %>.<%= columns.first.name %>
h1 "<%= resource %> with id: #{@<%= underscored_resource %>.id}"
render_actions
render_<%= underscored_resource %>_fields
end
Expand Down

0 comments on commit ae73017

Please sign in to comment.