Sha256: e7a92ef274666eec4eccba2b29861990e3acecd36f6a6da15c0f98e5e41a2732

Contents?: true

Size: 680 Bytes

Versions: 64

Compression:

Stored size: 680 Bytes

Contents

class UsersController < ApplicationController
  # GET /users
  def index
    @users = User.all
  end
  
  # GET /users/1
  def show
    @user = User.find(params[:id])
  end
  
  # GET /users/new
  def new
    @user = User.new
  end
  
  # GET /users/1/edit
  def edit
    @user = User.find(params[:id])
  end
  
  # POST /users
  def create
    @user = User.new(params[:user])
    
    if @user.save
      redirect_to(@user)
    else
      render :action => 'new'
    end
  end
  
  # PUT /users/1
  def update
    @user = User.find(params[:id])
    
    if @user.update_attributes(params[:user])
      redirect_to(@user)
    else
      render :action => 'edit'
    end
  end
end

Version data entries

64 entries across 64 versions & 15 rubygems

Version Path
state_machine_updated_for_ruby_3_2-2.0.0 examples/rails-rest/controller.rb
telvue_state_machine-1.2.3 examples/rails-rest/controller.rb
telvue_state_machine-1.2.2 examples/rails-rest/controller.rb
state_machine_deuxito-0.0.1 examples/rails-rest/controller.rb
telvue_state_machine-1.2.1 examples/rails-rest/controller.rb
cm-state_machine-1.2.0.1 examples/rails-rest/controller.rb
spree-state_machine-2.0.0.beta4 examples/rails-rest/controller.rb
spree-state_machine-2.0.0.beta3 examples/rails-rest/controller.rb
spree-state_machine-2.0.0.beta2 examples/rails-rest/controller.rb
spree-state_machine-2.0.0.beta1 examples/rails-rest/controller.rb
culturecode-state_machine-1.2.1 examples/rails-rest/controller.rb
joelind-state_machine-0.8.1 examples/rails-rest/controller.rb
pluginaweek-state_machine-0.7.6 examples/rails-rest/controller.rb
pluginaweek-state_machine-0.8.0 examples/rails-rest/controller.rb
automat-1.2.0 examples/rails-rest/controller.rb
glebtv_state_machine-1.3.0 examples/rails-rest/controller.rb
state_machine-1.2.0 examples/rails-rest/controller.rb
state_machine-1.1.2 examples/rails-rest/controller.rb
state_machine-1.1.1 examples/rails-rest/controller.rb
state_machine-1.1.0 examples/rails-rest/controller.rb