Forum: Ruby on Rails RE: Form -> File save tutorial

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.
Hogan, Brian P. (Guest)
on 2006-02-13 17:08
(Received via mailing list)
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.
Bill W. (Guest)
on 2006-02-13 17:54
(Received via mailing list)
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
Zachary Zolton (Guest)
on 2006-02-13 17:59
(Received via mailing list)
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?
Thibaut Barrère (Guest)
on 2006-02-13 18:15
(Received via mailing list)
> 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
Paul R. (Guest)
on 2006-02-13 18:59
(Received via mailing list)
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?
Jorge S. (Guest)
on 2006-02-13 19:24
(Received via mailing list)
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.
>


--
This topic is locked and can not be replied to.