diff --git a/app/views/rules/confirm.html.erb b/app/views/rules/confirm.html.erb index ab934641..28be9496 100644 --- a/app/views/rules/confirm.html.erb +++ b/app/views/rules/confirm.html.erb @@ -1,10 +1,13 @@ <%= render DialogComponent.new(reload_on_close: true) do |dialog| %> - <% if @rule.name.present? %> - <%= dialog.with_header(title: "Confirm changes to \"#{@rule.name}\"") %> - <% else %> - <%= dialog.with_header(title: "Confirm changes") %> - <% end %> - + <% + title = if @rule.name.present? + "Confirm changes to \"#{@rule.name}\"" + else + "Confirm changes" + end + %> + <% dialog.with_header(title: title) %> + <% dialog.with_body do %>

You are about to apply this rule to diff --git a/app/views/rules/edit.html.erb b/app/views/rules/edit.html.erb index b4ef58e0..f73edc90 100644 --- a/app/views/rules/edit.html.erb +++ b/app/views/rules/edit.html.erb @@ -1,11 +1,14 @@ <%= link_to "Back to rules", rules_path %> <%= render DialogComponent.new do |dialog| %> - <% if @rule.name.present? %> - <%= dialog.with_header(title: "Edit #{@rule.resource_type} rule \"#{@rule.name}\"") %> - <% else %> - <%= dialog.with_header(title: "Edit #{@rule.resource_type} rule") %> - <% end %> + <% + title = if @rule.name.present? + "Edit #{@rule.resource_type} rule \"#{@rule.name}\"" + else + "Edit #{@rule.resource_type} rule" + end + %> + <% dialog.with_header(title: title) %> <% dialog.with_body do %> <%= render "rules/form", rule: @rule %>