Non-functioning submit button

I have a form for users to select from a set of files they’d like to
download (all, by default), set up something like this:

<%= start_form_tag(:action => “download”) %>

<% @file_types.each do |ft| %> <%= ft %> files.
<% end %>
<%= end_form_tag %>
<%= submit_tag("Download") %>

Unfortunately, clicking on the “Download” button does nothing. Changing
the action doesn’t make any difference.I’ve used similar code with other
forms on the site and they work, so the fault must be in the code above.
Can anyone suggest what the problem could be with it?
Thanks.

can you try to switch those two lines ?

<%= end_form_tag %>

<%= submit_tag(“Download”) %>

to

<%= submit_tag(“Download”) %>
<%= end_form_tag %>

your submit butto has something like a context, the form.

Marcel

On 25 Mai, 11:36, Milo T. [email protected]

Hi Thurston.
Same functionality i want to implement in my application i.e i want
to download the files seelcted by checkbox.

Can you provide the download method implemented in your code.

actually i have written my own method in controller it is not
working.But if use this method as a download link it is working.
What i understand is here the download method is not able to get the
id with check boxes.And i have checked in log file i am able collect
all the ids which are selected by checkbox.Now the problem here is the
download method i have written could not able to get the id from
group of ids.

can you suggest me how to implement this.

my code details:
in views;

<% for containerformat in @containerformats %>
<% if i==0 %>

Streamname
<%= check_box_tag "containerformat_ids[]",containerformat.id%> <%=h containerformat.streamName %> <%= link_to 'Show', containerformat %> <%= link_to 'Edit', edit_containerformat_path (containerformat) %> <%= link_to "download", {:controller=> "containerformats", :action => "selected", :id => containerformat.id} %>
<% end %> <% end %> <%= submit_tag "Mark as Complete" %> <% end %>
---- in controller: -------------------- def selected

@containerformat = Containerformat.find(containerformat_ids[])
if (FileTest.exist?(@containerformat.location))
fileptr = File.open(@containerformat.location,“rb”){ |f|
@data = f.read(fileptr)}
ext = File.extname(@containerformat.streamName)

        if ext == ''
           extension = File.extname(@containerformat.location)
           send_data(@data,:filename => @containerformat.name

+extension,
:disposition => ‘attachment’)
else
send_data(@data,:filename =>
@containerformat.streamName,
:disposition => ‘attachment’)
end
end

end


can you suggest me where i am doing the mistake.
Thanks
Srikanth

On May 25 2007, 4:24 pm, Milo T. <rails-mailing-l…@andreas-

lanzm wrote:

<%= end_form_tag %>

<%= submit_tag(“Download”) %>

to

<%= submit_tag(“Download”) %>
<%= end_form_tag %>

That works, thanks.
Strange, as I didn’t encounter the problem elsewhere.