TypeError in TemplateController

Hi
I am new to Ruby programming… I am facing one problem. I am
displaying the files under a particular directory. I have kept all the
directories as hyperlink. I have coded in such a way that when i click
on a particular directory it has to display all the files under that.

But iam getting an error ’ TypeError in TemplateController
can’t convert nil into String’ when i click on the link.

This is the code snippet where iam taking all the files

for file_name in 0..array_count-1
  if(@clicked_file==$subdirectory_files[file_name])

render_text("Selected file : " +

$subdirectory_files[file_name]);
filepath=$theme_root + “/” + $current_directory + “/” +
$clicked_link + “/” + $subdirectory_files[file_name];

    File.open(filepath,"r") do |f|
        f.each_line { |line|
        $theme_files=$theme_files+line;
        }
        end

  end
end

This is the code snippet in .rhtml file

<% if(!$subdirectory_files.empty?)%> <% $subdirectory_files.each do |file_name|%> <%= link_to_remote file_name, :update => "files",:url => { :action => "get_file_data", :id => file_name }%>
<%end%> <%end%>

Please anyone help in this regard

Thanks,
Srividhya

On 2/10/07, Sri V. [email protected] wrote:

This is the code snippet where iam taking all the files
$theme_files=$theme_files+line;
<% $subdirectory_files.each do |file_name|%>
<%= link_to_remote file_name, :update => “files”,:url => { :action =>
“get_file_data”, :id => file_name }%>


<%end%>
<%end%>

Please anyone help in this regard

Which line throws that error?


gnufied

There was only one Road; that it was like a great river: its springs
were at every doorstep, and every path was its tributary.

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