Displaying 2 results from an estimated 2 matches for "notice_good".
2006 Aug 08
4
Creating a child simultaneously with parent via form
...he
form, but I suspect I can achieve this in a more rails-esque manner.
Here is my controller method:
def signup
@user = User.new(params[:user])
@address = Address.new(params[:address])
return unless request.post?
if @user.save
@address.user_id = @user.id
if @address.save
flash[:notice_good] = "Your account needs to be now be
activated. You have been sent a confirmation email with activation
instructions."
redirect_to :controller => "/shop", :action => "index"
end
end
end
Maybe this is OK, but any clues would be appreciated.
2006 Nov 04
0
Functional test issue for testing newbie
...dating attributes via a post
request in a functional test.
Here''s some pastes:
######################################
# account_controller.rb
def edit_details
@user = User.find(self.current_user.id)
return unless request.post?
if @user.update_attributes(params[:user])
flash[:notice_good] = ''Your account details were successfully updated.''
redirect_to :action => ''index''
else
render :action => ''edit_details''
end
end
# account_controller_test.rb
def test_should_update_user
# login as valid user
post :login...