ruby on rails - public_activity custom activities -
ruby on rails - public_activity custom activities -
i seek store activity using #create_activity public_activity gem:
model
class grouping < activerecord::base include publicactivity::common end
controller
def send_invitation @user = user.where(email: params[:user][:email]) @user.create_activity :send_invitation, owner: @group, recipient: @user redirect_to root_path end
the error
undefined method `create_activity' #user::activerecord_relation:0x007febb0f0a610
use should use @user = user.where(email: params[:user][:email]).first
instead. without first, homecoming activerecord relation specified in error
ruby-on-rails public-activity
Comments
Post a Comment