Вопрос

I have a very simple admin controller in my Rails 2 app that displays all the records for a model read-only:

class Admin::InspectionsController < ApplicationController

  active_scaffold :inspections do |config|
    [:create, :update, :delete].each {|a| config.actions.exclude a}
    config.actions.exclude :nested
  end
end

I wish to make these model objects editable, but only if they are in a certain state (ie, before they've been approved). I can do this for all Inspections by removing :update from the exclusions list, but I don't want to enable editing wholesale.

Is there a way to specify conditional actions to ActiveScaffold?

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top