I'm using the acts_as_follower gem. I'm also using Devise for my user model and instead of a format like users/:id, I've allowed users to have username URLs. I'm working on allowing users to follow each other, but after a user is followed, Rails fails to redirect to the user's profile. Here's my code.
User Controller
def show
@user = User.find_by_username(params[:id].downcase)
end
def follow
@user = User.find(params[:id])
if current_user
current_user.follow(@user)
redirect_to @user.username
else
flash[:error] = "You Must be logged in"
end
end
Here's the error that I'm getting in my server.
ERROR URI::InvalidURIError: the scheme http does not accept registry part: localhost:3000alaxics (or bad hostname?)