Skip to content

Business intelligence made simple

New check shortcut

Andrew Kane5c7b2d9e59d4
diff --git a/app/controllers/blazer/checks_controller.rb b/app/controllers/blazer/checks_controller.rb
index 55bf837e..3b1b5740 100644
--- a/app/controllers/blazer/checks_controller.rb
+++ b/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
diff --git a/app/views/blazer/_nav.html.erb b/app/views/blazer/_nav.html.erb
index 4251f87f..a9d76f1f 100644
--- a/app/views/blazer/_nav.html.erb
+++ b/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>