<% if @problems == true %>
<%= button_to_function "Далее", "$(this).attr('disabled','disabled'); $('#window2').modal('hide'); $('#new_problems').modal('show')"%>
<% else %>
<%= button_to_function "Сохранить", "$(this).attr('disabled','disabled'); $('form:first').submit();"%>
<% end %>
<%= button_to_function "Отмена", "$('#window2').modal('hide');"%>