Guest User

Untitled

a guest
May 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # POST /ballots
  2. # POST /ballots.xml
  3. def create
  4. @ballot = Ballot.new(params[:ballot])
  5. @executive = Executive.find(:first, :conditions => ["user_id = '#{current_us
  6. er.id}'"])
  7. @ballot.executive_id = @executive.id
  8.  
  9. respond_to do |format|
  10. if @ballot.save
  11. flash[:notice] = 'Ballot was successfully created.'
  12. format.html { redirect_to(@ballot) }
  13. format.xml { render :xml => @ballot, :status => :created, :location =>
  14. @ballot }
  15. else
  16. format.html { render :action => "new" }
  17. format.xml { render :xml => @ballot.errors, :status => :unprocessable_e
  18. ntity }
  19. end
  20. end
  21. end
Add Comment
Please, Sign In to add comment