Use select_tag for issue filter fields instead of abusing select
This commit is contained in:
parent
f227804093
commit
e8942437c0
2 changed files with 7 additions and 7 deletions
|
@ -26,12 +26,12 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@issues = @issues.where(:status => params[:status][0]) if params[:status] && params[:status][0].present?
|
@issues = @issues.where(:status => params[:status]) if params[:status] && params[:status].present?
|
||||||
|
|
||||||
@issues = @issues.where(:reportable_type => params[:issue_type][0]) if params[:issue_type] && params[:issue_type][0].present?
|
@issues = @issues.where(:reportable_type => params[:issue_type]) if params[:issue_type] && params[:issue_type].present?
|
||||||
|
|
||||||
if params[:last_updated_by] && params[:last_updated_by][0].present?
|
if params[:last_updated_by] && params[:last_updated_by].present?
|
||||||
last_updated_by = params[:last_updated_by][0].to_s == "nil" ? nil : params[:last_updated_by][0].to_i
|
last_updated_by = params[:last_updated_by].to_s == "nil" ? nil : params[:last_updated_by].to_i
|
||||||
@issues = @issues.where(:updated_by => last_updated_by)
|
@issues = @issues.where(:updated_by => last_updated_by)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
<%= form_tag(issues_path, :method => :get) do %>
|
<%= form_tag(issues_path, :method => :get) do %>
|
||||||
<p><%= t ".search_guidance" %></p>
|
<p><%= t ".search_guidance" %></p>
|
||||||
<%= select :status, nil, options_for_select(Issue.aasm.states.map(&:name).map{|state| [t("issues.states.#{state}"), state]}, params[:status]), { :include_blank => t(".select_status")}, data: { behavior: 'category_dropdown' } %>
|
<%= select_tag :status, options_for_select(Issue.aasm.states.map(&:name).map{|state| [t("issues.states.#{state}"), state]}, params[:status]), :include_blank => t(".select_status"), :data => { :behavior => 'category_dropdown' } %>
|
||||||
<%= select :issue_type, nil, options_for_select(@issue_types, params[:issue_type]), { :include_blank => t(".select_type")}, data: { behavior: 'category_dropdown' } %>
|
<%= select_tag :issue_type, options_for_select(@issue_types, params[:issue_type]), :include_blank => t(".select_type"), :data => { :behavior => 'category_dropdown' } %>
|
||||||
<%= text_field_tag :search_by_user, params[:search_by_user], placeholder: t(".reported_user") %>
|
<%= text_field_tag :search_by_user, params[:search_by_user], placeholder: t(".reported_user") %>
|
||||||
<%= select :last_updated_by, nil, options_for_select(@users.all.collect{|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], params[:last_updated_by]), { :include_blank => t(".select_last_updated_by")}, data: { behavior: 'category_dropdown' } %>
|
<%= select_tag :last_updated_by, options_for_select(@users.all.collect{|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], params[:last_updated_by]), :include_blank => t(".select_last_updated_by"), :data => { :behavior => 'category_dropdown' } %>
|
||||||
<%= submit_tag t(".search"), :name => nil %>
|
<%= submit_tag t(".search"), :name => nil %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue