Forum: Ruby on Rails mail_to tag

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.
0db277fb2005de6dd41368ca62dc25c6?d=identicon&s=25 Mahendra (Guest)
on 2007-06-14 11:02
Hi,

  In my html i use textarea and on submit button i want to place
textarea
content in body of mailer opened using mail_to tag.
how it is possible. I am using the ruby code.
4c3acdc3d93f54cc7a7281780ec8a4ee?d=identicon&s=25 shai (Guest)
on 2007-06-14 11:33
first off, make sure that the content you want to be in the body is
assigned;
( content_var = "text submitted in texarea" )

and then:

mail_to "email@someplace", "Mail to someplace", :body => content_var

which will create a link

<a href="mailto:
email@someplace?body=text%20submitted%20in%20text%20area">
   Mail to someplace
</a>

neat enough?
btw, generally speaking, there is a cool api for ruby on rails called,
(suprisingly enough) api.rubyonrails.com

 i found the above info right here:

  http://api.rubyonrails.com/classes/ActionView/Help...

hth,
shai
This topic is locked and can not be replied to.