Skip to content

Commit

Permalink
Hide action on create
Browse files Browse the repository at this point in the history
- Only show when updating a student
  • Loading branch information
jonny5 authored and h-m-m committed May 31, 2024
1 parent 00a676f commit cc1649b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/views/admin/students/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ and renders all form fields for a resource's editable attributes.
</div>
<% end %>
</fieldset>
<div class="field-unit">
<div class="field-unit__label"><label>Cash balance</label></div>
<div class="field-unit__field">
<%= sprintf('%.2f', page.resource&.portfolio&.cash_balance || 0)%>
<% if action_name == 'edit' %>
<div class="field-unit">
<div class="field-unit__label"><label>Cash balance</label></div>
<div class="field-unit__field">
<%= sprintf('%.2f', page.resource&.portfolio&.cash_balance || 0)%>
</div>
</div>
</div>
<div class="field-unit">
<div class="field-unit__label"><label>Add funds</label></div>
<div class="field-unit__field">
<input step="any" type="number" name="student[add_fund_amount]" id="student_add_fund_amount">
<div class="field-unit">
<div class="field-unit__label"><label>Add funds</label></div>
<div class="field-unit__field">
<input step="any" type="number" name="student[add_fund_amount]" id="student_add_fund_amount">
</div>
</div>
</div>
<% end %>
<% end -%>

<div class="form-actions">
Expand Down

0 comments on commit cc1649b

Please sign in to comment.