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
<%end%> <%end%>
Please anyone help in this regard
Thanks,
Srividhya