Sha256: 0c7cca054a9ec4626eb084e4ed215233d6e5d6a627a9ac3a9983b72bf4d6af64

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

module Gemgento
  class UsersController < ApplicationController
    before_filter :auth_user, except: [:update, :index]

    respond_to :json, :html

    def index
      @user = current_user

      respond_to do |format|
        format.html
        format.json { render json: @user.as_json({ store: current_store }) }
      end
    end

    def show
      @user = current_user

      respond_to do |format|
        format.html
        format.json { render json: @user.as_json({ store: current_store }) }
      end
    end

    private

    def auth_user
      redirect_to new_user_session_path unless user_signed_in?
    end

    def user_params
      params.require(:user).permit(:first_name, :last_name, :email, :middle_name, :prefix, :suffix, :password, :password_confirmation)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/controllers/gemgento/users_controller.rb