Sha256: 8f624bb45d7d5605543ef59f4abfd380f9bec0048e9a98946cfef7947098e30f

Contents?: true

Size: 246 Bytes

Versions: 3

Compression:

Stored size: 246 Bytes

Contents

class ButtonsController < ApplicationController
  before_filter :load

  def show
  end

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

private

  def load
    @button = Button.first || Button.create!
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
state_pattern-2.0.1 ./examples/rails_2_3_8_button_example/app/controllers/buttons_controller.rb
state_pattern-2.0.0 ./examples/rails_2_3_8_button_example/app/controllers/buttons_controller.rb
state_pattern-1.3.0 ./examples/rails_2_3_8_button_example/app/controllers/buttons_controller.rb