This way we can move some of the view logic to the Ruby class. It'll also make it easier to write tests for it.
16 lines
436 B
Plaintext
16 lines
436 B
Plaintext
<% if @progress_bar.primary? %>
|
|
<% bar_title = t("admin.progress_bars.edit.title.primary") %>
|
|
<% else %>
|
|
<% bar_title = t("admin.progress_bars.edit.title.secondary", title: @progress_bar.title) %>
|
|
<% end %>
|
|
|
|
<% provide :title do %>
|
|
<%= "#{t("admin.header.title")} - #{bar_title}" %>
|
|
<% end %>
|
|
|
|
<%= back_link_to progress_bars_index %>
|
|
|
|
<h2><%= bar_title %></h2>
|
|
|
|
<%= render Admin::ProgressBars::FormComponent.new(@progress_bar) %>
|