Hi
I partially succeeded in this .But there is also a problem What
I did is just add a :active boolean column to users table . Now I can
save company ( so user also) without session maintenece. But my
requirement is after this just redirect to login page and from there
login to pplication by giving email and password which was saved in
last step. But since :active column is false cant login
My question is whether in the same scenario can I save company
model(with user) and by any means by adding some obserever in the user
model and say “Please save without session maintanace”. This was my
first question
class User < ActiveRecord::Base
acts_as_authentic
belongs_to :company
end
class Company < ActiveRecord::Base
has_many :users
accepts_nested_attributes_for :users
end
My companies controller is
def new @company = Company.new
1.times { @company.users.build }
end
def create
@company = Company.new(params[:company])
if @company.valid_with_captcha? and @company.save
flash[:notice] = "Thanks for registering. Please login"
redirect_to login_url
else
render :action => :new
end
end
So here I have no control over save_without_session_maintenance
(Or I dont know how to do it) The problem is after this save (one
company and a user)
it is not redireted to login_url . I think some cookie is set. Can I
save company and user from the above code?
Thanks
Tom
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.