Hi Folks, I’m trying to render a partial from my controller, but nothing
happens. What’s wrong ???
Heres are my controller, views, and partials
1 - Controller :
def generer
render :update do |page|
page.replace_html( "message_div", :partial => "files_list")
end
end
def read
puts 'test'
send_file(params[:fic],:type => 'application/pdf' ,
:disposition =>
‘attachment’)
end
2 - View:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<%= t :titre1 %> <%= javascript_include_tag 'calendrier_fnc.js' %> <%= javascript_include_tag 'prototype.js' %> <%= javascript_include_tag :defaults %><%form_tag({ :action => :generer }, {:id=>‘form1’}) do -%>
<div class="floatLeft generes">
<%= submit_tag t(:titre17) %>
</div>
<div id="message_div">
<% if ! @file_name_arr.nil? %>
<%= render :partial => "files_list" %>
<% end %>
</div>
....
3 - Partial (_file_list.html.erb)
<% @file_name_arr.each do |fic| %>
<p>
<%= link_to fic.to_s, {:action =>'read', :id => nil, :fic
=> fic} %>
<% end %>