XaoGao / Todoser

Clone trello
3 stars 11 forks source link

Ошибка при переходе к favorites #191

Open XaoGao opened 2 years ago

XaoGao commented 2 years ago

Если нажать в navbar на ссылку Favorites то появляется ошибка

wrong number of arguments (given 4, expected 3)

class Task::TaskComponent < ViewComponent::Base
  attr_reader :project, :task, :status

  def initialize(project, status, task)
    @project = project
    @task = task
    @status = status
  end

Скорей всего нужно в файле new app/views/favorites/index.html.slim исправить входные параметры в строке

= render Task::TaskComponent.new(favorite.project, nil, favorite, current_user)
XaoGao commented 1 year ago

@sas2job возьми в работу

sas2job commented 1 year ago

После исправления ошибки возникает проблема с рендеренгом favourite component undefined method `favorited' for #

  def initialize(favoriteable:)
    @favoriteable = favoriteable
    @user = Current.user
    @status = favoriteable.favorited
  end