Skip to content

Commit

Permalink
Final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zachgoll committed Jun 13, 2024
1 parent 54af86b commit 9f24f7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def list
def new
@account = Account.new(
balance: nil,
accountable: Accountable.from_type(params[:type])&.new,
accountable: Accountable.from_type(params[:type])&.new
)

if params[:institution_id]
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/institutions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ def new

def create
Current.family.institutions.create!(institution_params)
redirect_to accounts_path, notice: "Institution created"
redirect_to accounts_path, notice: t(".success")
end

def edit
end

def update
@institution.update!(institution_params)
redirect_to accounts_path, notice: "Institution updated"
redirect_to accounts_path, notice: t(".success")
end

def destroy
@institution.destroy!
redirect_to accounts_path, notice: "Institution deleted"
redirect_to accounts_path, notice: t(".success")
end

private
Expand Down
1 change: 0 additions & 1 deletion app/views/accounts/_institution_accounts.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<span><%= t(".add_account_to_institution") %></span>
<% end %>
<%= link_to edit_institution_path(institution),
class: "block w-full py-2 px-3 space-x-2 text-gray-900 hover:bg-gray-50 flex items-center rounded-lg",
data: { turbo_frame: :modal } do %>
Expand Down
6 changes: 6 additions & 0 deletions config/locales/views/institutions/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ en:
name: Financial institution name
new:
new_institution: New financial institution
create:
success: "Institution created"
update:
success: "Institution updated"
destroy:
success: "Institution deleted"

0 comments on commit 9f24f7d

Please sign in to comment.