full patch of "archives" is? if under rails root, then change code to

string = Rails.root.to_s+'/archives/results/'+r

or write down full path to archives directory

tom

On Aug 26, 2011, at 23:23 , thelo.g thelo wrote:

> @7stud no I do not, I might have bad explained the problem. the thing is 
> when i perform the following code:
> 
> No such file or directory -
> ./archives/results/Archives-2011-08-26-09-56-00-UTC.xml
> Extracted source (around line #1):
> 
> <% r = Result.find(@result).nameFile %>
> <% string = "./archives/results/" + r  %>
> <% f = File.open(string) %>
> 
> I got this error:
> No such file or directory -
> ./archives/results/Archives-2011-08-26-09-56-00-UTC.xml
> Extracted source (around line #1):
> 
> 1: <h1>Résultat</h1>
> <p>id :<%= @result %>
> 
> 
> <% r = Result.find(@result).nameFile %>
> <% string = "./archives/results/" + r  %>
> <% f = File.open(string) %>
> 
> 
> Rails.root: /home/thelo/RoR/ihm_test
> 
> Application Trace | Framework Trace | Full Trace
> app/views/pages/print_result.html.erb:1:in `initialize'
> app/views/pages/print_result.html.erb:1:in `open'
> app/views/pages/print_result.html.erb:1:in
> `_app_views_pages_print_result_html_erb__106515637_82305240_211210089'
> 
> and in the console
> ActionView::Template::Error (No such file or directory -
> ./archives/results/Archives-2011-08-26-09-56-00-UTC.xml
> 
> 
> So when i replace string by "Archives-2011-08-26-09-56-00-UTC.xml"
> everything is ok, no problem.
> I just want to understand why and fix this problem
> 
> Thanks
> 
> -- 
> 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@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
===============================================================================

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to