def update(id, <%= singular_model %>)
@<%= singular_model %> = <%= model_class_name %>.get(id)
raise NotFound unless @<%= singular_model %>
if @<%= singular_model %>.update(<%= singular_model %>)
redirect resource(@<%= singular_model %>), :message => {:notice => "<%= model_class_name %> was successfully updated"}
else
message[:error] = "<%= model_class_name %> failed to be updated"
display @<%= singular_model %>, :edit
end
end
def destroy(id)
@<%= singular_model %> = <%= model_class_name %>.get(id)
raise NotFound unless @<%= singular_model %>
if @<%= singular_model %>.destroy
redirect resource(:<%= plural_model %>), :message => {:notice => "<%= model_class_name %> was successfully deleted"}
else
raise InternalServerError
end
end