1
0

Unevaluable formulas return nil (instead of throwing error)

Filter formula errors are shown in filter view
This commit is contained in:
cryptogopher
2019-11-09 20:36:10 +01:00
parent 70b6e97b87
commit 67b0cd9b66
8 changed files with 32 additions and 19 deletions

View File

@@ -1,5 +1,7 @@
<fieldset id="filters" class="collapsible">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<%= error_messages_for @formula_q %>
<%= form_tag url, id: 'filters_form', method: :get, remote: true do %>
<table class="filter">
<tr>

View File

@@ -1,4 +1,7 @@
<% if @ingredients.any? { |i| i.persisted? } %>
<%= render :partial => 'ingredients/filters',
:locals => {:url => filter_project_ingredients_path(@project)} %>
<table class="list">
<thead>
<tr>

View File

@@ -1,4 +1,7 @@
<% if @nutrients.any? %>
<%= render :partial => 'ingredients/filters',
:locals => {:url => filter_nutrients_project_ingredients_path(@project)} %>
<%= render :partial => 'ingredients/options' %>
<table class="nutrients list odd-even">

View File

@@ -13,8 +13,6 @@
<%= render :partial => 'ingredients/form' %>
<h2><%= t ".heading" %></h2>
<%= render :partial => 'ingredients/filters',
:locals => {:url => filter_project_ingredients_path(@project)} %>
<div id='ingredients'>
<%= render :partial => 'ingredients/list' %>
</div>

View File

@@ -13,8 +13,6 @@
<%= render :partial => 'ingredients/form' %>
<h2><%= t ".heading" %></h2>
<%= render :partial => 'ingredients/filters',
:locals => {:url => filter_nutrients_project_ingredients_path(@project)} %>
<div id='nutrients'>
<%= render :partial => 'ingredients/list_nutrients' %>
</div>