Permalink
Browse files

auto-actions-for-project

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 3, 2013
1 parent df1d469 commit 1935d1b8970615158d295de7b97c185423c848d7
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/controllers/stories_controller.rb
@@ -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.