dimanche 21 janvier 2018

Rails 5 Could not find table ''

After setup the act_as_follower gem

and properly added the button_link on user view show and configure the routes and the controller

Rails spits out this error about did not find table ¨ and did not specify which table.

ActiveRecord::StatementInvalid in UsersController#follow Could not find table ''

just point to current_user.follow(@user) on users controller.

Someone have any idea about this issue?

def follow
  @user = User.friendly.find(params[:id])

    if current_user == @user
    flash[:error] = 'You cannot follow yourself.'
  else
  current_user.follow(@user)
end
end

Aucun commentaire:

Enregistrer un commentaire