Class: My::RegistersController
- Inherits:
-
BaseController
- Object
- BaseController
- My::RegistersController
- Defined in:
- app/controllers/wechat/my/registers_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #edit_code ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 20 def create new_register if @register.save render 'create', locals: { return_to: my_registers_url } else render :new, locals: { model: @register }, status: :unprocessable_entity end end |
#destroy ⇒ Object
49 50 51 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 49 def destroy @register.destroy end |
#edit ⇒ Object
33 34 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 33 def edit end |
#edit_code ⇒ Object
36 37 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 36 def edit_code end |
#index ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 5 def index @registers = current_user.registers if @registers.blank? new_register render :new else render 'index' end end |
#new ⇒ Object
16 17 18 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 16 def new new_register end |
#show ⇒ Object
30 31 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 30 def show end |
#update ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/wechat/my/registers_controller.rb', line 39 def update @register.assign_attributes(register_params) if @register.save render 'update', locals: { return_to: my_registers_url } else render :edit, locals: { model: @register }, status: :unprocessable_entity end end |