Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # POST /ballots
- # POST /ballots.xml
- def create
- @ballot = Ballot.new(params[:ballot])
- @executive = Executive.find(:first, :conditions => ["user_id = '#{current_us
- er.id}'"])
- @ballot.executive_id = @executive.id
- respond_to do |format|
- if @ballot.save
- flash[:notice] = 'Ballot was successfully created.'
- format.html { redirect_to(@ballot) }
- format.xml { render :xml => @ballot, :status => :created, :location =>
- @ballot }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @ballot.errors, :status => :unprocessable_e
- ntity }
- end
- end
- end
Add Comment
Please, Sign In to add comment