pools: remove pool list dropdown from add to pool dialog.
Autocomplete works better than trying to select the pool from a gigantic dropdown.
This commit is contained in:
@@ -19,10 +19,4 @@ class PoolElementsController < ApplicationController
|
||||
@pool.remove!(@post)
|
||||
respond_with(@pool, :location => post_path(@post))
|
||||
end
|
||||
|
||||
def all_select
|
||||
@pools = Pool.undeleted.order("name").select("id, name")
|
||||
@pools.each # hack to force rails to eager load
|
||||
@pools
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<div class="input">
|
||||
<label>Pool Name</label>
|
||||
<span id="pool-name-container"><%= text_field_tag "pool_name", "", :size => 20, :data => { autocomplete: "pool" } %></span>
|
||||
<span id="pool-name-hint" class="hint">Search for a pool containing (<%= link_to "see full list", all_select_pool_element_path, :remote => true %>)</span>
|
||||
</div>
|
||||
|
||||
<div class="input">
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
$("#pool-name-container").html(<%= raw select_tag("pool_id", options_for_select(@pools.map {|x| [x.name, x.id]})).to_json %>);
|
||||
$("#pool-name-hint").hide();
|
||||
@@ -182,11 +182,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
resource :order, :only => [:edit], :controller => "pool_orders"
|
||||
end
|
||||
resource :pool_element, :only => [:create, :destroy] do
|
||||
collection do
|
||||
get :all_select
|
||||
end
|
||||
end
|
||||
resource :pool_element, :only => [:create, :destroy]
|
||||
resources :pool_versions, :only => [:index] do
|
||||
member do
|
||||
get :diff
|
||||
|
||||
Reference in New Issue
Block a user