Sha256: 05918f171d3881983dcfbdb9997f7530748a9a45b3bcd1743c401034532c6cb9

Contents?: true

Size: 528 Bytes

Versions: 12

Compression:

Stored size: 528 Bytes

Contents

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

  def index
    @users = User.all
  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])
  end

  private

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

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_apps_pages-0.5.6 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.5 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.4 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.3 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.2 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.1 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.5.0 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.4.9 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.4.8 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.4.7 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.4.6 lib/generators/pages/users/templates/omniauth/users_controller.rb
rails_apps_pages-0.4.5 lib/generators/pages/users/templates/omniauth/users_controller.rb