Created
November 11, 2010 03:50
-
-
Save joemocha/671967 to your computer and use it in GitHub Desktop.
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
class CommentsController < ApplicationController | |
before_filter :require_user | |
def index | |
@comments = Comment.all | |
end | |
def new | |
end | |
def create | |
params[:comment][:user_id] = session[:user] | |
@comment = Comment.new params[:comment] | |
# @comment = Comment.create(@comment) | |
if @comment.save | |
redirect_to comment_path(@comment) | |
else | |
render :action => :new | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment