Read more

Consul 0.3.0 has a shortcut to quickly create an action map for CRUD controllers

Henning Koch
July 04, 2012Software engineer at makandra GmbH

In moderately complex authorization scenarios you will often find yourself writing a map like this:

class NotesController < ApplicationController
  power :notes, :map => {
    [:edit, :update] => :updatable_notes
    [:new, :create] => :creatable_notes
    [:destroy] => :destroyable_notes
  }
end
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Because this pattern is so common, Consul now has a shortcut :crud to do the same:

class NotesController < ApplicationController
  power :crud => :notes
end
Posted by Henning Koch to makandra dev (2012-07-04 11:08)