Skip to content

Commit

Permalink
home_controller fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
t3k4y authored and yksflip committed Nov 28, 2022
1 parent 5f2963d commit ad0a138
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def reference_calculator
@bank_accounts = @types.includes(:bank_account).map(&:bank_account).uniq.compact
@bank_accounts = [BankAccount.last] if @bank_accounts.empty?
else
redirect_to root_url, alert: I18n.t('group_orders.errors.no_member')
redirect_to root_path, alert: I18n.t('group_orders.errors.no_member')
end
end

def update_profile
if @current_user.update(user_params)
@current_user.ordergroup.update(ordergroup_params) if ordergroup_params
session[:locale] = @current_user.locale
redirect_to my_profile_url, notice: I18n.t('home.changes_saved')
redirect_to my_profile_path, notice: I18n.t('home.changes_saved')
else
render :profile
end
Expand Down Expand Up @@ -64,7 +64,7 @@ def ordergroup
# cancel personal memberships direct from the myProfile-page
def cancel_membership
if params[:membership_id]
membership = @current_user.memberships.find!(params[:membership_id])
membership = @current_user.memberships.find(params[:membership_id])
else
membership = @current_user.memberships.find_by_group_id!(params[:group_id])
end
Expand Down

0 comments on commit ad0a138

Please sign in to comment.