Skip to content

Instantly share code, notes, and snippets.

@devdiva
Created November 19, 2011 22:36
Show Gist options
  • Save devdiva/1379470 to your computer and use it in GitHub Desktop.
Save devdiva/1379470 to your computer and use it in GitHub Desktop.
Missing Code for Lesson 14
# The following step on the curriculum is missing some code
# http://railsbridge-curriculum.heroku.com/14
# This is for the 11/19/2011 session
#Add the following method to Vote in app/controllers/votes_controller.rb:
class VotesController < ApplicationController
def create
topic = Topic.find(params[:topic_id])
vote = topic.votes.build
vote.save!
redirect_to(topics_path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment