Method: Effective::Resources::Controller#resource_klass_actions

Defined in:
app/models/effective/resources/controller.rb

#resource_klass_actionsObject

This is the fallback for render_resource_actions when no actions are specified, but a class is given Used by Datatables new



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'app/models/effective/resources/controller.rb', line 103

def resource_klass_actions
  {}.tap do |buttons|
    if collection_get_actions.find { |a| a == :index }
      buttons["All #{human_plural_name}".titleize] = { action: :index, default: true }
    end

    if collection_get_actions.find { |a| a == :new }
      buttons["New #{human_name}".titleize] = { action: :new, default: true }
    end

    (collection_get_actions - crud_actions).each do |action|
      buttons[action.to_s.titleize] = { action: action, default: true }
    end
  end
end