Displaying 1 result from an estimated 1 matches for "post_response".
2006 Jan 23
1
Display form and process return values with same method?
Is it sensible to use the same method in a controller to both display a
form and process its return values?
So instead of new and create methods you would just have new.
Pseudo-code:
def new
if system.post_response? then
@user = User.create(params[:user])
@user.save
else
@user = User.new
end
end
Disclaimer: system.post_response? is completly made up! Basically i
guess it should return true if params[] has something in it.
Cheers Pete.
--
Posted via http://www.ruby-forum.com/.