Created
July 6, 2012 23:57
-
-
Save scottmagdalein/3063463 to your computer and use it in GitHub Desktop.
likes_controller#create
This file contains hidden or 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
def create | |
@like = Like.new(params[:like]) | |
@like = @applicant.likes.new(params[:likes]) | |
@like.user_id = current_user.id | |
respond_to do |format| | |
if @like.save | |
format.html { redirect_to @like, notice: 'Like was successfully created.' } | |
format.json { render json: @like, status: :created, location: @like } | |
else | |
format.html { render action: "new" } | |
format.json { render json: @like.errors, status: :unprocessable_entity } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment