Sha256: 9a373521e2952b75af02c850c783de5bfc1e673fa968ac647b0ca28a87d75492

Contents?: true

Size: 555 Bytes

Versions: 18

Compression:

Stored size: 555 Bytes

Contents

module Effective
  class PollsController < ApplicationController
    before_action(:authenticate_user!) if defined?(Devise)

    def show
      poll = Effective::Poll.find(params[:id])

      EffectiveResources.authorize!(self, :show, poll)

      ballot = Effective::Ballot.where(poll: poll, user: current_user).first

      if ballot.present?
        redirect_to effective_polls.poll_ballot_build_path(poll, ballot, ballot.next_step)
      else
        redirect_to effective_polls.poll_ballot_build_path(poll, :new, :start)
      end
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
effective_polls-0.7.3 app/controllers/effective/polls_controller.rb
effective_polls-0.7.2 app/controllers/effective/polls_controller.rb
effective_polls-0.7.1 app/controllers/effective/polls_controller.rb
effective_polls-0.7.0 app/controllers/effective/polls_controller.rb
effective_polls-0.6.2 app/controllers/effective/polls_controller.rb
effective_polls-0.6.1 app/controllers/effective/polls_controller.rb
effective_polls-0.6.0 app/controllers/effective/polls_controller.rb
effective_polls-0.5.6 app/controllers/effective/polls_controller.rb
effective_polls-0.5.5 app/controllers/effective/polls_controller.rb
effective_polls-0.5.4 app/controllers/effective/polls_controller.rb
effective_polls-0.5.3 app/controllers/effective/polls_controller.rb
effective_polls-0.5.2 app/controllers/effective/polls_controller.rb
effective_polls-0.5.1 app/controllers/effective/polls_controller.rb
effective_polls-0.5.0 app/controllers/effective/polls_controller.rb
effective_polls-0.4.1 app/controllers/effective/polls_controller.rb
effective_polls-0.4.0 app/controllers/effective/polls_controller.rb
effective_polls-0.3.0 app/controllers/effective/polls_controller.rb
effective_polls-0.2.0 app/controllers/effective/polls_controller.rb