Simplify new question form
In this form, the only case where `poll` might be present without `question.poll` being present to is going to be the `new` action. We can assign the poll in the `new` action and get rid of the `poll` variable in the form.
This commit is contained in:
@@ -16,6 +16,7 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController
|
||||
@polls = Poll.all
|
||||
proposal = Proposal.find(params[:proposal_id]) if params[:proposal_id].present?
|
||||
@question.copy_attributes_from_proposal(proposal)
|
||||
@question.poll = @poll
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
Reference in New Issue
Block a user