you can use Lession.find_by_category_id params[:id]