lib/ditty/helpers/response.rb in ditty-0.6.0 vs lib/ditty/helpers/response.rb in ditty-0.7.0.pre.rc1
- old
+ new
@@ -41,9 +41,10 @@
def read_response(entity)
respond_to do |format|
format.html do
actions = {}
actions["#{base_path}/#{entity.id}/edit"] = "Edit #{heading}" if policy(entity).update?
+ actions["#{base_path}/new"] = "New #{heading}" if policy(entity).create?
title = heading(:read) + (entity.respond_to?(:name) ? ": #{entity.name}" : '')
haml :"#{view_location}/display",
locals: { entity: entity, title: title, actions: actions },
layout: layout
end