Permalink
Browse files

more-auto-actions

We'll now continue and configure the available actions for all of the controllers. So far we've seen the black-list style where you list what you *don't* want:

    auto_actions :all, :except => :index
{: .ruby}

There's also white-list style where you list what you do want, e.g.

    auto_actions :index, :show
{: .ruby}

There's also a handy shortcut to get just the read-only routes (i.e. the ones that don't modify the database)

	auto_actions :read_only
{: .ruby}

The opposite is handy for things that are manipulated by ajax but never viewed directly:

	auto_actions :write_only # short for -- :create, :update, :destroy
{: .ruby}

Work through your controllers and have a think about which actions you want. You need to end up with:

SHOW_PATCH

Have a play with the application with this set of actions in place. Looking pretty good!
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 2371666 commit aff18baedc64f3250c44beef1ebdc99273f651a9
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/controllers/stories_controller.rb
  2. +1 −1 app/controllers/tasks_controller.rb
@@ -2,7 +2,7 @@ class StoriesController < ApplicationController
hobo_model_controller
auto_actions :all
auto_actions :all, :except => :index
auto_actions_for :project, [:new, :create]
@@ -2,7 +2,7 @@ class TasksController < ApplicationController
hobo_model_controller
auto_actions :all, :except => :index
auto_actions :write_only, :edit
auto_actions_for :story, :create

0 comments on commit aff18ba

Please sign in to comment.