<%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %>
<% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %>
<%= link_to_function l(:button_save),
- "$('query_form').action='#{ @project ? new_project_query_path : new_query_path }'; submit_query_form('query_form')",
+ "$('query_form').action='#{ @project ? new_project_query_path(@project) : new_query_path }'; submit_query_form('query_form')",
:class => 'icon icon-save' %>
<% end %>
</p>