From a266ced3c5b8f9cb70a27871dedc58ef0f5f8b0c Mon Sep 17 00:00:00 2001 From: Michael Dolbin Date: Thu, 15 Jun 2017 12:50:53 +0300 Subject: [PATCH] Confirmation dialog to occupy a parking lot --- app/views/parkings/_parking_data.html.erb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/parkings/_parking_data.html.erb b/app/views/parkings/_parking_data.html.erb index 6bd84f2..28d5c75 100644 --- a/app/views/parkings/_parking_data.html.erb +++ b/app/views/parkings/_parking_data.html.erb @@ -21,11 +21,7 @@ <%= f.hidden_field :occupied, value: !place.occupied%>
- <% if place.occupied %> - <%= f.submit button_title(place), class: 'btn btn-lg btn-block btn-primary', data: { confirm: "Освободить место ##{place.number}?" }%> - <% else %> - <%= f.submit button_title(place), class: 'btn btn-lg btn-block btn-primary' %> - <% end %> + <%= f.submit button_title(place), class: 'btn btn-lg btn-block btn-primary', data: { confirm: "#{place.occupied ? 'Освободить' : 'Занять'} место ##{place.number}?" }%>
<%end%>