Sha256: 68e272a9a7cbd2d530b7134bbfda0285f0ae8f58aeb990f98ec5357cf8607463

Contents?: true

Size: 221 Bytes

Versions: 5

Compression:

Stored size: 221 Bytes

Contents

class ButtonsController < ApplicationController
  before_filter do
    @button = Button.first || Button.create!
  end

  def show
  end

  def push
    flash[:notice] = @button.push!
    redirect_to button_path
  end
end

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
state_pattern-2.0.2 ./examples/rails_4_button_example/app/controllers/buttons_controller.rb
state_pattern-2.0.2 ./examples/rails_3_button_example/app/controllers/buttons_controller.rb
state_pattern-2.0.1 ./examples/rails_3_button_example/app/controllers/buttons_controller.rb
state_pattern-2.0.0 ./examples/rails_3_button_example/app/controllers/buttons_controller.rb
state_pattern-1.3.0 ./examples/rails_3_button_example/app/controllers/buttons_controller.rb