Wrong number of arguments (2 for 1)

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs