1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
paper-trail-gem--paper_trail/spec/dummy_app/app/controllers/widgets_controller.rb
Jared Beck 94b9306647 Finish the conversion to RSpec
- Convert serializers/mixin_json_test.rb to rspec
- Convert functional/thread_safety_test.rb to rspec
- Convert functional/controller_test.rb to rspec
- Move the dummy app from test to spec, delete test dir
2017-06-10 01:45:46 -04:00

28 lines
494 B
Ruby

class WidgetsController < ApplicationController
def paper_trail_enabled_for_controller
request.user_agent != "Disable User-Agent"
end
def create
@widget = Widget.create widget_params
head :ok
end
def update
@widget = Widget.find params[:id]
@widget.update_attributes widget_params
head :ok
end
def destroy
@widget = Widget.find params[:id]
@widget.destroy
head :ok
end
private
def widget_params
params[:widget].permit!
end
end