Last active
May 30, 2016 11:12
-
-
Save aya-soft/0efe89811d05fa90bb85c571e9eae01c to your computer and use it in GitHub Desktop.
Контроллеры в пространстве имен Profile предназначены для работы с данными конкретных пользователей!Как же ты тут выбираешь из базы все комменты без разбора?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile::ServiceStationCommentsController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :load_spare, only: [:index, :new] | |
def index | |
@comments = ServiceStationComment.all | |
end |
У меня список своих комментариев пользователь видит на странице своего сервисного центра service_station index. Внизу в табличке. Я удалил этот экшн чтобы не путаться
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Сравни например:
ВИДИШЬ??? запросы конкретного клиента!
@delivery_inquiries = current_user.client.delivery_inquiries.filtered_by(params[:filter]).order("created_at desc").paginate(page: params[:page], per_page: 10)