Sha256: e14a66591c66187b9276f28f1d56cefb4e6dfe3bcbc554ae8235b2dc89ec7bb8

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 Bytes

Contents

module Formol
  class PollVotesController < ApplicationController
    include Controllers::Nested::HasParentTopic
    
    def create
      formol_authorize!(current_formol_user, :vote_poll, topic)
      
      poll.vote(current_formol_user, params['poll']['poll_vote_ids'])
    rescue Formol::Poll::PollException => e
      flash[:error] = t(e.message)
    ensure
      respond_to do |format|
        format.html { redirect_to [topic.forum, topic] }
      end
    end
    
    protected
    
    def poll
      @poll ||= topic.poll
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formol-0.0.6 app/controllers/formol/poll_votes_controller.rb
formol-0.0.5 app/controllers/formol/poll_votes_controller.rb
formol-0.0.4 app/controllers/formol/poll_votes_controller.rb