Hi guys,
I’m using attachment_fu to upload large files, and when the user presses
submit on the form action/view and calls the “create” action, it
uploads the file, and then redirects the user to an index action/view.
However, b/c of the size of the file and the time it takes to upload, I
would like to show the actual view for “create”, having it say something
like “please be patient while your file uploads”.
While I have simply tried making a view for my “create” action, it does
not work. After pressing submit on the form view, it simply stalls on
that page while the file is being uploaded and then automatically issues
the redirect at the end of my create action, without ever showing me the
view for create.
How would I force the app to actually show the view that goes along w/
create, while the file is being uploaded and before the redirect?
A very simplified version of the code:
controller:
[code=]
def form
@post = Post.new
end
def create
@post = Post.new(params[:post])
if @post.save
redirect_to :action => ‘index’
end
end[/code]
The form view:
<% form_tag ({:action => 'create'}, :multipart => true) do %>
<%= file_field_tag 'post', :size => 50 -%>
<%= submit_tag 'Submit' %>
<%end%>
Thanks in advance for the help everyone.
-shoma