Dear all,
    In my web application, The client has to enter a set of values and I 
want to write them to a text file. This is what I am doing to achieve that. 

class SollusController < ApplicationController
  def index 
  end
  def new
        @s=Sollu.new
  end
  def create
        @s=Sollu.new
        @s.save
        afile=File.open("network.txt",'w') 
        afile.write(@s.input)
        afile.close
        redirect_to sollus_path
     end

  def show    
  end
end


But after I enter the values from the the browser, nothing gets saved in 
the file "network.txt". On the contrary, If I do this whole thing in ruby 
console as below,

s=Sollu.new
s.input="I need to write this to text file"
afile=File.open("network.txt",'w')
afile.write(s.input)
afile.close()

After i run the above lines, I can see the text in the intended file. 

Can you please help me in debugging this part?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/kmEzliZQPqgJ.
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