Use resource from load_and_authorize_resource in admin polls controller
This commit is contained in:
@@ -7,18 +7,18 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
|
|||||||
before_action :load_geozones, only: [:new, :create, :edit, :update]
|
before_action :load_geozones, only: [:new, :create, :edit, :update]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@polls = Poll.not_budget.created_by_admin.order(starts_at: :desc)
|
@polls = @polls.not_budget.created_by_admin.order(starts_at: :desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@poll = Poll.find(params[:id])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@poll = Poll.new(poll_params.merge(author: current_user))
|
@poll.author = current_user
|
||||||
|
|
||||||
if @poll.save
|
if @poll.save
|
||||||
notice = t("flash.actions.create.poll")
|
notice = t("flash.actions.create.poll")
|
||||||
if @poll.budget.present?
|
if @poll.budget.present?
|
||||||
|
|||||||
Reference in New Issue
Block a user