Пытаюсь приписать юзера но rails ругается ActiveRecord::RecordInvalid in CommentsController#create Возникли ошибки: User не может быть пустым
# Not implemented: check to see whether the user has permission to create a comment on this object
@comment = Comment.build_from(@obj, current_user, @comment_hash[:body])
if @comment.save!
render :partial => "comments/comment", :locals => { :comment => @comment }, :layout => false, :status => :created
else
redirect_to root_path
в контроллере прописано
class CommentsController < ApplicationController
def create
@comment_hash = params[:comment]
@obj = @comment_hash[:commentable_type].constantize.find(@comment_hash[:commentable_id])
# Not implemented: check to see whether the user has permission to create a comment on this object
@comment = Comment.build_from(@obj, current_user, @comment_hash[:body])
if @comment.save!
render :partial => "comments/comment", :locals => { :comment => @comment }, :layout => false, :status => :created
else
redirect_to root_path
end
end
end
не могу понять в чем проблема?
Использую rails 4.0.0.0
ruby 2.0.0
gem 'acts_as_commentable_with_threading', :github => 'elight/acts_as_commentable_with_threading', :branch => 'master'
по мотивам статьи
twocentstudios.com/blog/2012/11/15/simple-ajax-com...
Помогите пожалуйста