Skip to content

Commit

Permalink
auto-actions-for-project
Browse files Browse the repository at this point in the history
Here's another similar trick. Browse to one of your projects. You'll see the page says "No stories to display" but there's no way to add one. Hobo has support for this but we need to switch it on. Add the following declaration to the stories controller:

SHOW_PATCH

This creates nested routes and their corresponding actions:

 - `/project/123/stories/new` routed to `StoriesController#new_for_project`
 - `/project/123/stories` (POST) routed to `StoriesController#create_for_project`

Hobo's page generators will respond to the existence of these routes and add a "New Story" link to the project page, and an appropriate "New Story" page.
  • Loading branch information
bryanlarsen authored and iox committed Jun 6, 2013
1 parent df1d469 commit 1935d1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/stories_controller.rb
Expand Up @@ -4,4 +4,6 @@ class StoriesController < ApplicationController

auto_actions :all

auto_actions_for :project, [:new, :create]

end

0 comments on commit 1935d1b

Please sign in to comment.