On 12/27/2011 07:54 PM, ifarkas(a)redhat.com wrote:
From: Imre Farkas<ifarkas(a)redhat.com>
---
src/app/controllers/application_controller.rb | 2 +-
src/app/views/layouts/_popup-error.rhtml | 4 ++++
src/app/views/layouts/popup-error.rhtml | 4 ----
src/public/javascripts/application.js | 6 ++++--
4 files changed, 9 insertions(+), 7 deletions(-)
create mode 100644 src/app/views/layouts/_popup-error.rhtml
delete mode 100644 src/app/views/layouts/popup-error.rhtml
diff --git a/src/app/controllers/application_controller.rb
b/src/app/controllers/application_controller.rb
index 0044124..3ffaefe 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -86,7 +86,7 @@ class ApplicationController< ActionController::Base
def html_error_page(title, msg, status)
if request.xhr?
- render :template => 'layouts/popup-error', :layout =>
'popup', :status => status,
+ render :partial => 'layouts/popup-error', :status => status,
:locals => {:title => title, :errmsg => msg}
else
render :template => 'layouts/error', :layout =>
'application',
diff --git a/src/app/views/layouts/_popup-error.rhtml
b/src/app/views/layouts/_popup-error.rhtml
new file mode 100644
index 0000000..094c13a
--- /dev/null
+++ b/src/app/views/layouts/_popup-error.rhtml
@@ -0,0 +1,4 @@
+<%- content_for :title do -%>
+<%= title %>
+<%- end -%>
+<%= errmsg %>
diff --git a/src/app/views/layouts/popup-error.rhtml
b/src/app/views/layouts/popup-error.rhtml
deleted file mode 100644
index 094c13a..0000000
--- a/src/app/views/layouts/popup-error.rhtml
+++ /dev/null
@@ -1,4 +0,0 @@
-<%- content_for :title do -%>
-<%= title %>
-<%- end -%>
-<%= errmsg %>
diff --git a/src/public/javascripts/application.js
b/src/public/javascripts/application.js
index d2c262b..04fb4d3 100644
--- a/src/public/javascripts/application.js
+++ b/src/public/javascripts/application.js
@@ -20,8 +20,10 @@ $.extend(Conductor, {
var url = $(this).attr('href');
$('#tab').html('<span
class="loading_tabs"></span>');
$.get(url, function(data) {
- $('#tab').html(data)
- .show();
+ $('#tab').html(data).show();
+ })
+ .error(function(data) {
+ $('#tab').html(data.responseText).show();
});
Conductor.tabRemoveActiveClass();
ACK to both patches.