Skip to content

Commit

Permalink
filtering-stories-by-status-controller
Browse files Browse the repository at this point in the history
If you try to use the filter widget, you'll see it adds a `status` parameter in the query string. We need to pick that up and do something useful with it in the Projects controller at `app/controllers/projects_controller.rb`.  To do so, we will use an [association scope](/manual/scopes#association_scopes).

SHOW_PATCH

Status filtering should now be working.
  • Loading branch information
bryanlarsen authored and iox committed Aug 12, 2013
1 parent da669bc commit 2b18116
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/projects_controller.rb
Expand Up @@ -9,6 +9,7 @@ def show
@stories = @project.stories.
search(params[:search], :title).
order_by(parse_sort_param(:title, :status))
@stories = @stories.status_is(params[:status]) if params[:status] && !params[:status].blank?
hobo_show
end

Expand Down

0 comments on commit 2b18116

Please sign in to comment.