Skip to content

Instantly share code, notes, and snippets.

@fatihorhan
Last active November 25, 2016 22:54
Show Gist options
  • Save fatihorhan/860867fd9a04e63a64e3c88412848c64 to your computer and use it in GitHub Desktop.
Save fatihorhan/860867fd9a04e63a64e3c88412848c64 to your computer and use it in GitHub Desktop.
Bad sample controller with non-CRUD methods
# app/controllers/payments_controller.rb
class PaymentsController < ApplicationController
skip_before_action :verify_authenticity_token, :only => :bank_return
before_action :prevent_blocked_account, only: :create
def index
end
def show
end
def create
end
def track_cc
end
def bank_return
end
private
def payment_params
end
def bank_return_params
end
end
# config/routes.rb
Rails.application.routes.draw do
# ...
resources :payments do
collection do
post :track_cc
post :bank_return
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment