On 2/10/07, Sri Vidhya
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> 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
>
> <div id="filenames">
> <% if(!$subdirectory_files.empty?)%>
> <% $subdirectory_files.each do |file_name|%>
> <b><%= link_to_remote file_name, :update =>
"files",:url => { :action =>
> "get_file_data", :id => file_name }%></b><br>
> <%end%>
> <%end%>
> </div>
>
> 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.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---