Skip to content

Commit

Permalink
Refactored to use json
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jul 7, 2010
1 parent 8f56bfb commit 171e1cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/features_controller.rb
Expand Up @@ -178,7 +178,7 @@ def file
@file = File.read(@feature.path)
respond_to do |format|
format.html
format.js { render :html => @file }
format.js { render :json => @file.to_json }
end
end

Expand Down
6 changes: 4 additions & 2 deletions public/javascripts/jquery.ajax.dialog.js
Expand Up @@ -18,13 +18,15 @@ $(function() {
$.ajax({
url: $('a#file-feature').attr('href'),
type: 'GET',
dataType: 'html',
dataType: 'json',
complete: function(xhr, textStatus) {
},
success: function(data, textStatus, xhr) {
// populate dialog box with content
var $wrapper = $('<pre>').append($('<code>'));

$dialog
.append(data)
.append($wrapper.append(data))
.dialog({
title: 'Source feature content',
width: '95%',
Expand Down

0 comments on commit 171e1cd

Please sign in to comment.