Skip to content

Instantly share code, notes, and snippets.

@drew5020
Created November 24, 2011 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drew5020/1391738 to your computer and use it in GitHub Desktop.
Save drew5020/1391738 to your computer and use it in GitHub Desktop.
Attempted Controller Code
class FavoritesController < ApplicationController
def create
@user = User.find(session[:user_id])
@link = Link.find(params[:id])
@favorite = @user.favorites.create :link_id => @link.id
redirect_to :back
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment