Forum: Ruby on Rails Wrong number of arguments (2 for 1)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
John Q. (Guest)
on 2006-04-18 20:46
The code below gives me the following error:
wrong number of arguments (2 for 1)

It goes though this code twice. The first everything works and it
Q*** Action name is index
Q*** Controller name is welcome
protect? welcome / index

The second time, I get this error and it prints:
Q*** Action name is signup
Q*** Controller name is user

It seems like it should work.

Any ideas?

module UserSystem

  def protect?(controller, action)
    puts "protect? #{controller} / #{action}"
    if ['welcome', 'user'].include?(controller)
      return false
      return true

  def login_required
    puts "Q*** Action name is #{action_name}"
    puts "Q*** Controller name is #{controller_name}"
    if not protect?(controller_name, action_name)
      return true

    if user? and authorize?(@session['user'])
      return true
This topic is locked and can not be replied to.