Render :update do |page| issue

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 %>

On 2010/7/19 Mamadou Touré [email protected] wrote:

I’m trying to render a partial from my controller, but nothing
happens. What’s wrong ???

2 - View:

<% if ! @file_name_arr.nil? %>
<%= render :partial => “files_list” %>

3 - Partial (_file_list.html.erb)

“files” vs “file”.

-Dave


Specialization is for insects. | Professional: http://davearonson.com
-Robert Anson Heinlein | Programming: http://codosaur.us
-------------------------------+ Leadership: http://dare2xl.com
Have Pun, Will Babble! -me | Et Cetera: http://davearonson.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs