Sha256: a5723a4039bb1fe74cb78177acb40e68f43c9f6a98a83937df9394a00635b196

Contents?: true

Size: 625 Bytes

Versions: 4

Compression:

Stored size: 625 Bytes

Contents

require_dependency "billing/application_controller"

module Billing
  class AccountsController < ApplicationController
    before_action :set_account, except: [:index, :new, :create]
    
    def index
      @accounts = billable.billing_accounts
    end
    
    def new
      @account = billable.billing_accounts.new
    end
    
    def create
      @account = billable.billing_accounts.new
      if @account.save
        redirect_to @account
      else
        render action: :new
      end
    end
    
    private
      def set_account
        @account = billable.billing_accounts.find(params[:id]) 
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
billing-0.0.4b app/controllers/billing/accounts_controller.rb
billing-0.0.4a app/controllers/billing/accounts_controller.rb
billing-0.0.4 app/controllers/billing/accounts_controller.rb
billing-0.0.3 app/controllers/billing/accounts_controller.rb