diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 5b0d3108e..04a94cce3 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -22,7 +22,12 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController def create @poll = Poll.new(poll_params.merge(author: current_user)) if @poll.save - redirect_to [:admin, @poll], notice: t("flash.actions.create.poll") + notice = t("flash.actions.create.poll") + if @poll.budget.present? + redirect_to admin_poll_booth_assignments_path(@poll), notice: notice + else + redirect_to [:admin, @poll], notice: notice + end else render :new end diff --git a/app/models/poll.rb b/app/models/poll.rb index 9d706b020..553baf036 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -114,4 +114,7 @@ class Poll < ActiveRecord::Base end end + def budget_poll? + budget.present? + end end diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index 31388ce3c..c63ee4789 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -42,7 +42,7 @@ <% if budget.poll.present? %> - <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_path(budget.poll) %> + <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_booth_assignments_path(budget.poll) %> <% else %> <%= link_to_create_budget_poll(budget) %> <% end %> diff --git a/app/views/admin/poll/polls/_subnav.html.erb b/app/views/admin/poll/polls/_subnav.html.erb index 98e23003b..f72176a9e 100644 --- a/app/views/admin/poll/polls/_subnav.html.erb +++ b/app/views/admin/poll/polls/_subnav.html.erb @@ -1,18 +1,20 @@