Sha256: 271c1b68696d752cd76893c5b9ad772aaaec00e0211e38c01e048e251ec1f9d9

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

module Admin
  class PollsController < ApplicationController
    before_action(:authenticate_user!) if defined?(Devise)
    before_action { EffectiveResources.authorize!(self, :admin, :effective_polls) }

    include Effective::CrudController

    def results
      @poll = Effective::Poll.find(params[:id])
      EffectiveResources.authorize!(self, :results, @poll)

      @datatable = Admin::EffectivePollResultsDatatable.new(poll_token: @poll.token)
      @page_title = "#{@poll} Results"
    end

    def permitted_params
      params.require(:effective_poll).permit!
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_polls-0.3.0 app/controllers/admin/polls_controller.rb
effective_polls-0.2.0 app/controllers/admin/polls_controller.rb