On Sat, Jan 7, 2012 at 10:40 AM, Libber <amarnath.alapati@gmail.com> wrote:
> 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.
> def create
> @s=Sollu.new
> @s.save
> afile=File.open("network.txt",'w')
> afile.write(@s.input)
> afile.close
> redirect_to sollus_path
> end
> But after I enter the values from the the browser, nothing gets saved in the
> file "network.txt".
No kidding. Where above do you imagine that `@s.input` is magically
acquiring a value?
You should run through a basic Rails tutorial on using forms...
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment