Skip to content

Commit

Permalink
stories-table-add-search
Browse files Browse the repository at this point in the history
To get the search feature working, we need to update the controller side. Add a `show` method to `app/controllers/projects_controller.rb` and update the `<table-plus>` to use `@stories`:

SHOW_PATCH

(To do -- explain how that works!)
  • Loading branch information
bryanlarsen committed Nov 14, 2011
1 parent 648442a commit ed18dd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/projects_controller.rb
Expand Up @@ -4,4 +4,11 @@ class ProjectsController < ApplicationController

auto_actions :all

def show
@project = find_instance
@stories =
@project.stories.apply_scopes(:search => [params[:search], :title],
:order_by => parse_sort_param(:title, :status))
end

end
2 changes: 1 addition & 1 deletion app/views/projects/show.dryml
@@ -1,6 +1,6 @@
<show-page>
<collection: replace>
<table-plus:stories fields="this, tasks.count, status">
<table-plus with="&@stories" fields="this, tasks.count, status">
<empty-message:>No stories match your criteria</empty-message:>
</table-plus>
</collection:>
Expand Down

4 comments on commit ed18dd6

@johntomkins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example how can you order by tasks.count as well? Im having this problem on my table.

@bryanlarsen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please post your question to hobousers and I'll answer there. There are a bunch of different factors in play that make this difficult, but not impossible.

@johntomkins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get onto Hobo Users on this domain at my workplace, please can you answer it here or by email?

@johntomkins
Copy link

@johntomkins johntomkins commented on ed18dd6 Jul 12, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.