spec/dummy/app/controllers/application_controller.rb in draftsman-0.4.0 vs spec/dummy/app/controllers/application_controller.rb in draftsman-0.5.0

- old
+ new

@@ -1,20 +1,27 @@ class ApplicationController < ActionController::Base protect_from_forgery + before_action :set_draftsman_whodunnit def create - Trashable.new(:name => 'Bob').draft_creation - render nothing: true + Trashable.new(name: 'Bob').draft_creation + head :no_content end def update trashable = Trashable.last trashable.name = 'Sam' trashable.draft_update - render nothing: true + head :no_content end def destroy Trashable.last.draft_destruction - render nothing: true + head :no_content + end + + private + + def draftsman_enabled_for_controller + request.user_agent != 'Disable User-Agent' end end