Skip to content

Action cable def with params #22

Closed
@MTEKode

Description

@MTEKode

Hi,
def test doesn't work but def test1 works
When I have a def with params like

TestChannel < ApplicationCable::Channel
  def test(data)
    @test
  end
  def test1
     @test
  end
  before :test do
    @test = Test.new
  end
end

[ArgumentError - wrong number of arguments (given 0, expected 1)]

It works when I remove:

  before :test do
    @test = Test.new
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions