RE: Form -> File save tutorial


#1

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.


#2

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: removed_email_address@domain.invalid
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: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Bill W.
Sent: Monday, February 13, 2006 7:28 AM
To: removed_email_address@domain.invalid
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
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#3

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?


#4

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?


#5

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…”?

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


#6

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 S.

On 2/13/06, Paul R. removed_email_address@domain.invalid wrote:

Is it just me or this list getting weird right now?


Paul R.