Forum: Ruby on Rails How to download a dynamically generated file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
934f858e451cf9b771996b2940cd696b?d=identicon&s=25 Raj Singh (dorelal)
on 2009-01-08 03:28
(Received via mailing list)
I need to provide users a link to download an  user_guide.txt file.

Currently the user_guide.html.erb looks like this.

Dear <%=@user.name %>,

Please visit <%=@unlocking_webiste %> site.

...
...

the point is that the file has some variables which needs to be
replaced then user should be able to download these files and use
them.

I can find ways to download a static file but in this case how should
I code such that users are able to download the customized files.

Thanks
29ebf90af6107d2eb39b587c7972639c?d=identicon&s=25 Mukund (Guest)
on 2009-01-08 10:22
(Received via mailing list)
Use render_to_string(options = nil, &block)  and use the send_data
API.
This topic is locked and can not be replied to.