Sha256: a6d63870c6f51862dee4eaaadc25515716958fc2f5529c14db67a99acb7c60e6

Contents?: true

Size: 494 Bytes

Versions: 8

Compression:

Stored size: 494 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
paper_trail-7.1.0 spec/dummy_app/app/controllers/widgets_controller.rb
paper_trail-7.0.3 test/dummy/app/controllers/widgets_controller.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paper_trail-7.0.2/test/dummy/app/controllers/widgets_controller.rb
paper_trail-7.0.2 test/dummy/app/controllers/widgets_controller.rb
paper_trail-7.0.1 test/dummy/app/controllers/widgets_controller.rb
paper_trail-7.0.0 test/dummy/app/controllers/widgets_controller.rb
paper_trail-6.0.2 test/dummy/app/controllers/widgets_controller.rb
paper_trail-6.0.1 test/dummy/app/controllers/widgets_controller.rb