class ActivitiesController < ApplicationController
  def index
    @user = User.find(params[:user_id])
    @activities = @user.activities.order('created_at DESC')

    respond_to do |format|
      format.html
      format.js
    end
  end
end
class ActivitiesController < ApplicationController
  def index
    @user = User.friendly.find(params[:user_id])
    @activities = @user.activities.order('created_at DESC')

    respond_to do |format|
      format.html
      format.js
    end
  end
end

Fix to use friendly_id syntax
Fix to use friendly_id syntax
