Class: Trade::My::PaymentMethodsController
- Inherits:
-
BaseController
- Object
- BaseController
- Trade::My::PaymentMethodsController
- Defined in:
- app/controllers/trade/my/payment_methods_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 19 def create @payment_method = current_buyer.payment_methods.build(payment_method_params) respond_to do |format| if @payment_method.detective_save format.html format.json { render json: @payment_method.as_json(methods: 'kind') } format.js else format.html { render :new } format.json format.js end end end |
#destroy ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 50 def destroy @payment_method.destroy respond_to do |format| format.html { head :no_cont } format.js end end |
#edit ⇒ Object
38 39 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 38 def edit end |
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 4 def index @payment_methods = current_buyer.payment_methods respond_to do |format| format.html { } format.json { render json: @payment_methods.as_json(methods: 'kind') } end end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 15 def new @payment_method = current_buyer.payment_methods.build end |
#show ⇒ Object
35 36 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 35 def show end |
#update ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'app/controllers/trade/my/payment_methods_controller.rb', line 41 def update @payment_method.assign_attributes(payment_method_params) if @payment_method.detective_save render 'update' else render :edit end end |