% if @page.valid? %>
window.location.href = '<%= url_for(@page) %>';
<% else -%>
$('#page_form .modal-body').prepend("
You need a valid and unique page title. Your page title can only consist of letters, numbers, dash (-) and underscore (_)
");
$('input#page_title').closest('.control-group').addClass('error');
<% end %>