Class: Share::WechatUsersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/wechat/share/wechat_users_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



35
36
37
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 35

def destroy
  @wechat_user.destroy
end

#editObject



19
20
21
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 19

def edit
  @wechat_tags = @app.wechat_tags
end

#indexObject



7
8
9
10
11
12
13
14
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 7

def index
  q_params = {
    'user_tags.tag_id': @scene.tag&.id
  }
  q_params.merge! params.permit(:name)

  @wechat_users = @app.wechat_users.default_where(q_params).page(params[:page])
end

#showObject



16
17
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 16

def show
end

#try_matchObject



31
32
33
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 31

def try_match
  @result = @wechat_user.try_match
end

#updateObject



23
24
25
26
27
28
29
# File 'app/controllers/wechat/share/wechat_users_controller.rb', line 23

def update
  @wechat_user.assign_attributes(wechat_user_params)

  unless @wechat_user.save
    render :edit, locals: { model: @wechat_user }, status: :unprocessable_entity
  end
end