I;m new in towm myself, but I think initialize is when the instance
itself initializes, not when the framework wants it to do something.
ActionController handles GETs and POSTs from the users, and with no
actions defined, I think it infers the action (and page) “index”.
Therefor:
def index
redirect_to :action => “signup_form”
end
might be more appropriate (assuming you have def signup_form somewhere
in this controller).
Cheers
Alexandre H. wrote:
Hello, I’m curious as to why this bit of code doesn’t work:
class SignupController < ApplicationController
def initialize
signup.call
end
def signup
redirect_to :action => “signup_form”
end
end
–
You have a nil object when you didn’t expect it!
The error occured while evaluating nil.rewrite
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.