Sha256: 0e2c24f8ad0fe05a12e59042cb3ad3acffb5597e29a44dbb7d8d2862b8140e40

Contents?: true

Size: 625 Bytes

Versions: 8

Compression:

Stored size: 625 Bytes

Contents

module Admin
  class PollsController < ApplicationController
    layout EffectivePolls.layout[:admin]

    before_action(:authenticate_user!) if defined?(Devise)
    before_action { EffectivePolls.authorize!(self, :admin, :effective_polls) }

    include Effective::CrudController

    def results
      @poll = Effective::Poll.find(params[:id])
      EffectivePolls.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

8 entries across 8 versions & 1 rubygems

Version Path
effective_polls-0.1.6 app/controllers/admin/polls_controller.rb
effective_polls-0.1.5 app/controllers/admin/polls_controller.rb
effective_polls-0.1.4 app/controllers/admin/polls_controller.rb
effective_polls-0.1.3 app/controllers/admin/polls_controller.rb
effective_polls-0.1.2 app/controllers/admin/polls_controller.rb
effective_polls-0.1.1 app/controllers/admin/polls_controller.rb
effective_polls-0.1.0 app/controllers/admin/polls_controller.rb
effective_polls-0.0.2 app/controllers/admin/polls_controller.rb