I'm also slowly plodding along on a part time project and struggling
with filters a little.

I'm trying to build an index page with filterable, sortable table. In
animals_controller.rb I have:

class AnimalsController < ApplicationController
  hobo_model_controller
  auto_actions :all
  def index
    hobo_index Animal.apply_scopes(
        :search => [params[:search], :name],
        :order_by  => parse_sort_param(:name, :species, :breed),
        :breed_is => params[:breedfilter])
  end
end

In animals/index.dryml I have:

<index-page>
  <collection: replace>
    <div>
      <table-plus  fields="this, species, breed">
        <prepend-header:>
          <div class="filter">
            Breed: <filter-menu param-name="breedfilter"
options="&Breed.all"/>
          </div>
        </prepend-header:>
        <empty-message:>No animals match your criteria</empty-
message:>
      </table-plus>
    </div>
  </collection:>
</index-page>

In animal.rb I have "belongs_to :breed", and the breed model has a
name, etc.

When the filter is set to a particular species, the data in the table
changes correctly, but the filter menu reads "All" instead of the
chosen species.  Picking a different breed has the same effect.
Picking "All" does nothing, i.e. does not remove the filter
condition.  I must be missing something obvious as usual.

By the way, does table-plus paginate?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to