<%= form_with model: access_token, url: (access_token.persisted? ? [:account, access_token] : [:account, @application, :access_tokens]), local: true, class: 'form' do |form| %> <%= render 'account/shared/forms/errors', form: form %> <% with_field_settings form: form do %> <%= render 'shared/fields/text_field', method: :description, options: {autofocus: true} %> <%# 🚅 super scaffolding will insert new fields above this line. %> <% end %>
<%= form.submit (form.object.persisted? ? t('.buttons.update') : t('.buttons.create')), class: "button" %> <% if form.object.persisted? %> <%= link_to t('global.buttons.cancel'), [:account, access_token], class: "button-secondary" %> <% else %> <%= link_to t('global.buttons.cancel'), [:account, @application, :access_tokens], class: "button-secondary" %> <% end %>
<% end %>