I want to develop a web application that allows a user to input data into a set of forms and then save that data in an XML file format to their hard drive. Can anybody point me to a Ruby\Rails tutorial that would help? Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060213/be45dcac/attachment.html
Pretty simple thing actually... Take the data from the forms, store it somewhere (db maybe or session) and then make an xml view (.rxml) that displays it back to the users. you can''t easily save things to a user''s hard drive, but you can make a link for them that they can right-click and save. (the link would obviously point to the controller and action that would render the rxml template.) (Just be sure to do render :layout=>false when you render the rxml template. Hope that nudges you along a bit. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Bill Walton Sent: Monday, February 13, 2006 7:28 AM To: rails@lists.rubyonrails.org Subject: [Rails] Form -> File save tutorial I want to develop a web application that allows a user to input data into a set of forms and then save that data in an XML file format to their hard drive. Can anybody point me to a Ruby\Rails tutorial that would help? Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060213/e8ccab80/attachment.html
MessageHi Brian, Thanks for the reply. Some of my target users will not have the web experience to understand the right-click thing. I''m wondering if there isn''t a way to present them with a "Save" button that would somehow then send the right-click message. Any thoughts? Also, what about Mac users? I haven''t had a Mac for years now, but don''t they still use a one-button mouse? How do they do a "Save target as..."? Thanks, Bill ----- Original Message ----- From: Hogan, Brian P. To: rails@lists.rubyonrails.org Sent: Monday, February 13, 2006 9:07 AM Subject: RE: [Rails] Form -> File save tutorial Pretty simple thing actually... Take the data from the forms, store it somewhere (db maybe or session) and then make an xml view (.rxml) that displays it back to the users. you can''t easily save things to a user''s hard drive, but you can make a link for them that they can right-click and save. (the link would obviously point to the controller and action that would render the rxml template.) (Just be sure to do render :layout=>false when you render the rxml template. Hope that nudges you along a bit. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Bill Walton Sent: Monday, February 13, 2006 7:28 AM To: rails@lists.rubyonrails.org Subject: [Rails] Form -> File save tutorial I want to develop a web application that allows a user to input data into a set of forms and then save that data in an XML file format to their hard drive. Can anybody point me to a Ruby\Rails tutorial that would help? Thanks, Bill ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060213/964f8884/attachment.html
How about have a link/button that redirects the user (or pops up a new window) to the view that creates the XML? Then, they could just do a File -> Save?
> Also, what about Mac users? I haven''t had a Mac for years now, but don''tthey still use a one-button mouse? How do they do a "Save> target as..."?as a newcomer to mac, I''ve been equally wondering ! (just like... how to I get this pipe | character on my azerty keyboard. is it also ctrl+alt+L on qwerty macs?) In Safari you just have to press ctrl then click to get alternative choices such as download to. Thibaut -- [blog] http://www.dotnetguru2.org/tbarrere -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060213/3ef48768/attachment.html
On 13 Feb 2006, at 16:13, Thibaut Barr?re wrote:> as a newcomer to mac, I''ve been equally wondering ! (just like... > how to I get this pipe | character on my azerty keyboard. is it > also ctrl+alt+L on qwerty macs?)No, it''s Shift-\ to get | on a UK mac keyboard. And yes, holding down ctrl whilst clicking will *always* give you the equivalent of a "right-click"... Is it just me or this list getting weird right now? -- Paul Robinson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060213/13ecf5cb/attachment.html
try something along the lines (untested): In controller: def save_to_xml xml_data = GENERATE_YOUR_XML_DATA_HERE send_data xml_data, :filename => "SOME_NAME_HERE.pdf", :type => "application/pdf" end In your view put a Link somewhere with the option target="_new" That should work BUT as said above it wasn''t tested. have fun Jorge Sousa On 2/13/06, Paul Robinson <paul@iconoplex.co.uk> wrote:> On 13 Feb 2006, at 16:13, Thibaut Barr?re wrote: > > > as a newcomer to mac, I''ve been equally wondering ! (just like... > > how to I get this pipe | character on my azerty keyboard. is it > > also ctrl+alt+L on qwerty macs?) > > No, it''s Shift-\ to get | on a UK mac keyboard. > > And yes, holding down ctrl whilst clicking will *always* give you the > equivalent of a "right-click"... > > Is it just me or this list getting weird right now? > > -- > Paul Robinson >-- ------------------------------- Jorge Sousa