Class: Admin::PollsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/polls_controller.rb

Instance Method Summary collapse

Instance Method Details

#clear_responsesObject

only_allow_access_to :index, :show, :new, :create, :edit, :update, :remove, :destroy,

:when => [:designer, :admin],
:denied_url => { :controller => 'admin/pages', :action => 'index' },
:denied_message => 'You must have designer privileges to perform this action.'


10
11
12
13
14
15
16
# File 'app/controllers/admin/polls_controller.rb', line 10

def clear_responses
  if @poll = Poll.find(params[:id])
    @poll.clear_responses
    flash[:notice] = t('polls_controller.responses_cleared', :poll => @poll.title)
  end
  redirect_to :action => :index
end