Sha256: d6fae3f7b877d771d4d7e27d759bc27d736219dc6ca116956da5a247661d1c67
Contents?: true
Size: 568 Bytes
Versions: 10
Compression:
Stored size: 568 Bytes
Contents
class CommentsController < Admin::BaseController layout 'application' skip_before_filter :authenticate_admin!, :only => [ :create, :new ] helper_method :entry, :comment def create if comment.save redirect_to entry_path(entry), :notice => 'Your comment was submitted' else render 'entries/show' end end private def entry @entry ||= Entry.find(params[:entry_id]) end def comment @comment ||= params[:id].blank? ? entry.comments.new(params[:comment]) : Comment.find(params[:id]) end end
Version data entries
10 entries across 10 versions & 1 rubygems