Explorar o código

New check shortcut

Andrew Kane %!s(int64=8) %!d(string=hai) anos
pai
achega
5c7b2d9e59

+ 1 - 1
app/controllers/blazer/checks_controller.rb

@@ -9,7 +9,7 @@ module Blazer
     end
 
     def new
-      @check = Blazer::Check.new
+      @check = Blazer::Check.new(query_id: params[:query_id])
     end
 
     def create

+ 2 - 1
app/views/blazer/_nav.html.erb

@@ -10,6 +10,7 @@
     <li role="separator" class="divider"></li>
     <li><%= link_to "New Query", new_query_path %></li>
     <li><%= link_to "New Dashboard", new_dashboard_path %></li>
-    <li><%= link_to "New Check", new_check_path %></li>
+    <% check_params = @query ? {query_id: @query.id} : {} %>
+    <li><%= link_to "New Check", new_check_path(check_params) %></li>
   </ul>
 </div>