Sha256: 5ae6034825f91d0c42a5c29025a05722ba0827191e7316ff2c4e657dae7eed1c

Contents?: true

Size: 565 Bytes

Versions: 10

Compression:

Stored size: 565 Bytes

Contents

class UsersController < ApplicationController
  before_filter :authenticate_user!
  before_filter :correct_user?, :except => [:index]

  def index
    @users = User.all
    authorize User
  end

  def edit
    @user = User.find(params[:id])
  end

  def update
    @user = User.find(params[:id])
    if @user.update_attributes(secure_params)
      redirect_to @user
    else
      render :edit
    end
  end

  def show
    @user = User.find(params[:id])
    authorize @user
  end

  private

  def secure_params
    params.require(:user).permit(:email)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_apps_pages-0.5.15 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.14 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.13 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.12 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.11 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.10 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.9 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.8 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.7 lib/generators/pages/authorized/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.6 lib/generators/pages/authorized/templates/omniauth/users_controller.rb