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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title><%= t :titre1 %></title>
<link rel="stylesheet" href="/stylesheets/main.css"
type="text/css" />
<%= javascript_include_tag ''calendrier_fnc.js'' %>
<%= javascript_include_tag ''prototype.js'' %>
<%= javascript_include_tag :defaults %>
</head>
<%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>
</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} %>
</p>
<% end %>
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.