Navigation Menu

Skip to content

Commit

Permalink
remove-project-actions
Browse files Browse the repository at this point in the history
# 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 committed Nov 14, 2011
1 parent 38ee18b commit fbf684f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/tasks_controller.rb
Expand Up @@ -2,6 +2,6 @@ class TasksController < ApplicationController

hobo_model_controller

auto_actions :all
auto_actions :all, :except => :index

end

0 comments on commit fbf684f

Please sign in to comment.