Created
September 15, 2010 21:49
-
-
Save oren/581553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view : | |
<%= render "missing_content" %> | |
_missing_content.html.erb : | |
<% if @missing_content %> | |
<h2> The following keys has no content on environment :</h2> | |
<% @missing_content.each do |language| %> | |
<ul> | |
<li> | |
<%= language[:language] %>- <%= language[:keys].join(',') %> | |
</li> | |
</ul> | |
<% end %> | |
<% end %> | |
get_missing_content.js.erb : | |
$("#missing_content").html("<%= escape_javascript( render 'missing_content' ) ) %>"); | |
application.js : | |
$(".current-environments input[type='radio']").click(function() { | |
$.ajax({ | |
url: '/get_missing_content', | |
success: function(data) {} | |
}); | |
}); | |
pages_controller: | |
def get_missing_content | |
@missing_content = [ {:language => 'english', :keys => ['key1', 'key2', 'key3']}, {:language => 'spanish', :keys => ['key1']}, {:language => 'russian', :keys => ['key4']} ] | |
respond_to do |format| | |
format.js | |
end | |
end | |
routes: | |
map.get_missing_content 'get_missing_content', | |
:controller => 'pages', | |
:action => 'get_missing_content', | |
:conditions => { :method => :get } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment