Hi Everyone,
I am working on a basic app that has a public facing form (for enquiries) that anyone can fill in and submit. The results are then stored for the company to do what they want with.
I have made sure that if the user is not logged in they can only access the create page, but once they submit the form, as expected, they are taken to the login page because its trying to show them the show page.
My current controller is as follows:
# POST /enquiries
# POST /enquiries.xml
def create
@enquiry = Enquiry.new(params[:enquiry])
respond_to do |format|
if @enquiry.save
format.html { redirect_to(@enquiry, :notice => 'Enquiry was successfully created.') }
format.xml { render :xml => @enquiry, :status => :created, :location => @enquiry }
else
format.html { render :action => "new" }
format.xml { render :xml => @enquiry.errors, :status => :unprocessable_entity }
end
end
end
I would imagine it's this line that needs to change:
format.html { redirect_to(@enquiry, :notice => 'Enquiry was successfully created.') }
Is it possible to do:
format.html { redirect_to(http://www.google.com) }
Thanks,
Danny