Add standardrb

This commit is contained in:
Andrew Tomaka 2023-03-07 22:09:33 -05:00
parent fe99fbc9de
commit 91e2a5f4ff
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
14 changed files with 87 additions and 53 deletions

View file

@ -1,5 +1,5 @@
class CreditCardBillsController < ApplicationController
before_action :set_credit_card_bill, only: %i[ show edit update destroy ]
before_action :set_credit_card_bill, only: %i[show edit update destroy]
# GET /credit_card_bills or /credit_card_bills.json
def index
@ -58,13 +58,14 @@ class CreditCardBillsController < ApplicationController
end
private
# Use callbacks to share common setup or constraints between actions.
def set_credit_card_bill
@credit_card_bill = CreditCardBill.find(params[:id])
end
# Only allow a list of trusted parameters through.
def credit_card_bill_params
params.require(:credit_card_bill).permit(:description, :amount)
end
# Use callbacks to share common setup or constraints between actions.
def set_credit_card_bill
@credit_card_bill = CreditCardBill.find(params[:id])
end
# Only allow a list of trusted parameters through.
def credit_card_bill_params
params.require(:credit_card_bill).permit(:description, :amount)
end
end

View file

@ -1,5 +1,5 @@
class ExpensesController < ApplicationController
before_action :set_expense, only: %i[ show edit update destroy ]
before_action :set_expense, only: %i[show edit update destroy]
# GET /expenses or /expenses.json
def index
@ -58,13 +58,14 @@ class ExpensesController < ApplicationController
end
private
# Use callbacks to share common setup or constraints between actions.
def set_expense
@expense = Expense.find(params[:id])
end
# Only allow a list of trusted parameters through.
def expense_params
params.require(:expense).permit(:description, :payment, :period, :credit_card, :estimated)
end
# Use callbacks to share common setup or constraints between actions.
def set_expense
@expense = Expense.find(params[:id])
end
# Only allow a list of trusted parameters through.
def expense_params
params.require(:expense).permit(:description, :payment, :period, :credit_card, :estimated)
end
end

View file

@ -1,5 +1,5 @@
class IncomesController < ApplicationController
before_action :set_income, only: %i[ show edit update destroy ]
before_action :set_income, only: %i[show edit update destroy]
# GET /incomes or /incomes.json
def index
@ -58,13 +58,14 @@ class IncomesController < ApplicationController
end
private
# Use callbacks to share common setup or constraints between actions.
def set_income
@income = Income.find(params[:id])
end
# Only allow a list of trusted parameters through.
def income_params
params.require(:income).permit(:description, :included, :amount, :member_id)
end
# Use callbacks to share common setup or constraints between actions.
def set_income
@income = Income.find(params[:id])
end
# Only allow a list of trusted parameters through.
def income_params
params.require(:income).permit(:description, :included, :amount, :member_id)
end
end

View file

@ -1,5 +1,5 @@
class MembersController < ApplicationController
before_action :set_member, only: %i[ show edit update destroy ]
before_action :set_member, only: %i[show edit update destroy]
# GET /members or /members.json
def index
@ -58,13 +58,14 @@ class MembersController < ApplicationController
end
private
# Use callbacks to share common setup or constraints between actions.
def set_member
@member = Member.find(params[:id])
end
# Only allow a list of trusted parameters through.
def member_params
params.require(:member).permit(:name, :pays)
end
# Use callbacks to share common setup or constraints between actions.
def set_member
@member = Member.find(params[:id])
end
# Only allow a list of trusted parameters through.
def member_params
params.require(:member).permit(:name, :pays)
end
end