Created
November 19, 2011 22:36
-
-
Save devdiva/1379470 to your computer and use it in GitHub Desktop.
Missing Code for Lesson 14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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