test/dummy/app/controllers/users_controller.rb in watarase-0.0.3 vs test/dummy/app/controllers/users_controller.rb in watarase-0.0.4
- old
+ new
@@ -1,14 +1,14 @@
class UsersController < ApplicationController
- image_loadable :user, caches: true, expire_actions: [:update]
+ image_loadable :user, caches: true, expire_actions: [:update], save_actions: [:create, :update]
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
- @users = User.all
+ @users = User.all.merge(includes: [:user_image_holder])
end
# GET /users/1
# GET /users/1.json
def show
@@ -25,11 +25,11 @@
# POST /users
# POST /users.json
def create
@user = User.new(user_params)
- set_image_holder @user
+ #set_image_holder @user
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.json { render action: 'show', status: :created, location: @user }
@@ -42,10 +42,10 @@
# PATCH/PUT /users/1
# PATCH/PUT /users/1.json
def update
- set_image_holder @user
+ #set_image_holder @user
respond_to do |format|
if @user.update(user_params)
format.html { redirect_to @user, notice: 'User was successfully updated.' }
format.json { head :no_content }