Commit 2d07809eac55b7293e6203a2de0c7d1ab20c354b

Authored by Fellipe Souto Sampaio
Committed by Rafael Manzo
1 parent 698b4b83

Trying to create a gif animation to show while the processing isn't ready.

Signed-off By: Diego Araujo <diegoamc90@gmail.com>
app/controllers/modules_controller.rb
... ... @@ -32,6 +32,8 @@ class ModulesController &lt; ApplicationController
32 32 end
33 33  
34 34 # POST /project/1/repositories/42/modules/24
35   - def load_tree; end
  35 + def load_tree
  36 + render :partial => "modules/javascript.html.erb"
  37 + end
36 38  
37 39 end
38 40 \ No newline at end of file
... ...
app/views/modules/_javascript.html.erb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +<p>Testando um gif animado! GAN </p>
0 2 \ No newline at end of file
... ...
app/views/repositories/show.html.erb
... ... @@ -36,6 +36,14 @@
36 36 <% end %>
37 37  
38 38 <hr/>
  39 + <div id="teste"></div>
  40 + <script>
  41 + window.onload=function(){
  42 + $.post("project_load_module_tree").done(function(data){
  43 + $("#teste").append(data);
  44 + });
  45 + }
  46 + </script>
39 47  
40 48 <% if @processing.ready? %>
41 49 <h2>Modules Tree</h2>
... ...
config/routes.rb
... ... @@ -6,7 +6,7 @@ Mezuro::Application.routes.draw do
6 6  
7 7 resources :projects do
8 8 resources :repositories, except: [:update, :index]
9   - get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
  9 + get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
10 10 put '/repositories/:id' => 'repositories#update', as: :repository_update
11 11 post '/repositories/:id/modules/:module_result_id' => 'modules#load_tree', as: :load_module_tree
12 12 end
... ...