A
Aashish Kiran
Hi, I am getting exception with
redirect_to(user_contacts_path(@current_user)),
but redirect_to works in other part of same method.
Here is part of code, redirect_to works in else statement, but not
working inside if statement
Error is an attachement uploaded.
Can anyone please help me.
----------------------------------------------------------------------------
if params[:commit] == "upload and import contact"
if params[:import_file].nil?
flash[:notice] = 'No file was attached.'
p user_contacts_path(@current_user)
p @current_user.contacts
redirect_to(user_contacts_path(@current_user))
else
parse_vcard_file(params[:import_file], params[:user_id])
flash[:notice] = 'Contact was successfully created from VCard
file.'
redirect_to(user_contacts_path(@current_user))
end
else
end
------------------------------------------------------------------------
thank you,
Ashish
Attachments:
http://www.ruby-forum.com/attachment/4837/contactserror.htm
redirect_to(user_contacts_path(@current_user)),
but redirect_to works in other part of same method.
Here is part of code, redirect_to works in else statement, but not
working inside if statement
Error is an attachement uploaded.
Can anyone please help me.
----------------------------------------------------------------------------
if params[:commit] == "upload and import contact"
if params[:import_file].nil?
flash[:notice] = 'No file was attached.'
p user_contacts_path(@current_user)
p @current_user.contacts
redirect_to(user_contacts_path(@current_user))
else
parse_vcard_file(params[:import_file], params[:user_id])
flash[:notice] = 'Contact was successfully created from VCard
file.'
redirect_to(user_contacts_path(@current_user))
end
else
end
------------------------------------------------------------------------
thank you,
Ashish
Attachments:
http://www.ruby-forum.com/attachment/4837/contactserror.htm