Colin Ambler


120 Experience
1 Lesson Completed
0 Questions Solved


Do you have source code on this episode?

I implemented Chris' approach with below code. However it only considers "Create" (whereas with a f.submit button the text becomes flexible "Create" or "Update"). How would you accommodate this for edit scenario?

<%= form.button class: 'btn btn-primary' do %>
      <span class="show-when-enabled">Create Post</span>
      <span class="show-when-disabled">Processing...</span>
<% end %>

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2023 GoRails, LLC. All rights reserved.