Permalink
Browse files

remove-project-actions

# Removing actions

By default Hobo has given us a full set of restful actions for every single model/controller pair. Many of these routes are inappropriate for our application. For example, why would we want an index page listing every Task in the database? We only really want to see tasks listed against stories and users. We need to disable the routes we don't want.

There's an interesting change of approach here that often crops up with Hobo development. Normally you'd expect to have to build everything yourself. With Hobo, you often get given everything you want and more besides. Your job is to take away the parts that you *don't* want.

Here's how we would remove, for example, the index action from TasksController. In `app/controllers/tasks_controller.rb`, change

SHOW_PATCH

Refresh the browser and you'll notice that Tasks has been removed from the main nav-bar. Hobo's page generators adapt to changes in the actions that you make available.
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 054dea3 commit df1d469824b249471cda2b93f4e18663d9cb9c08
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/controllers/tasks_controller.rb
@@ -2,6 +2,6 @@ class TasksController < ApplicationController
hobo_model_controller
auto_actions :all
auto_actions :all, :except => :index
end

0 comments on commit df1d469

Please sign in to comment.