Displaying 20 results from an estimated 26 matches for "set_content_type".
2006 Oct 07
1
Request to open up getConnection to embedded interface
...e to write data to the
web browser in various formats:
dataprovider <- function(r){
args <- apache.get_args(r);
con <- dbConnect(dbDriver("MySQL"),dbname=db)
d <- dbGetQuery(con,"select * from table")
if (is.null(args$format)){
apache.set_content_type(r,"text/html")
if (length(d)>1)
HTML(d,file=stdout()) # from R2HTML
else
cat("<H1>Empty</H1>")
} else if (args$format == 'csv'){
apache.set_content_type(r,"text/csv")
writ...
2006 May 09
1
Email -Content type is not set to html
Hi to ROR!
I could not change the email content type to text/html
What is the problem!
order1= Order.find_get_details(params[:ses_value])
#render_text order1.size
order=order1[0]
email = OrderMailer.create_confirm(order)
email.set_content_type("text/html")
email = OrderMailer.deliver_confirm(order)
email.set_content_type("text/html")
Alwas it shows only plain format only what is the reason!
Thnaks and Regards,
Kumar
--
Posted via http://www.ruby-forum.com/.
2006 May 09
1
Emailcontewnt problem
I ma facing problems regarding the email-set-contentent
I am writing the total code for
order1= Order.find_get_details(params[:ses_value])
#render_text order1.size
order=order1[0]
email.set_content_type("text/html")
email = OrderMailer.create_confirm(order)
email.set_content_type("text/html")
email = OrderMailer.deliver_confirm(order)
#email = OrderMailer.deliver_confirm(order)
render(:text => "<pre>" + email.encoded + "</pre>")
Please help...
2006 Mar 10
3
WML sites
Hi all
how to make a WML view for rails pages?
I''ve tried to create like:
<wml>
<card>
CONTENT
</card>
</wml>
but my phone says unsupported content type...
thanks
--
Posted via http://www.ruby-forum.com/.
2005 Nov 08
2
Scriptaculous insertion fails when XHTML Strict used in FireFox
Hi !
I'm getting an uncaught exception requiring the Scriptaculous
libraries when everything says XHTML 1.0 Strict:
class ApplicationController < ActionController::Base
before_filter :set_content_type
protected
def set_content_type
response.headers['Content-Type'] = 'application/xhtml+xml;
charset=ISO-8859-1'
end
end
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http...
2006 Jul 19
4
Rails crashes my fcgid/fastcgi/scgi on apache2/lighttpd :<
..._email?
verification_email = OrderMailer.create_a_verification
(order, pre_tax_price, sales_tax)
emails_array << verification_email
end
}
flash[:notice] = ''Array Size: '' + emails_array.size.to_s
emails_array.each{ |email|
email.set_content_type("text/html")
OrderMailer.deliver(email)
}
redirect_to :action => "list"
end
-------------------
It doesn''t even start sending mails - it crashes somewhere in the
arrays when doing ''.each''. The order model is ~40 fields, mostl...
2009 Apr 09
1
Mailing error in Rails 2.3.2
...send_email(hsh)
raw_attachments = []
if hsh.has_key?(:raw_attachment)
raw_attachments.push(hsh[:raw_attachment])
end
mail=TMail::Mail.new
mail.to=hsh[:to]
mail.date=Time.now
mail.from=@user_name
mail.subject=hsh[:subject]
main=mail
main=TMail::Mail.new
main.body = hsh[:body]
puts main.body
main.set_content_type(''text/plain'', nil, ''charset''=>''utf-8'')
mail.parts.push(main)
for raw_attachment in raw_attachments
part = TMail::Mail.new
transfer_encoding=raw_attachment[:transfer_encoding]
body=raw_attachment[:body]
case (transfer_encoding || "&q...
2007 Dec 20
4
Ruby on Rails mailer
...art.rb:59:in ''to_mail''
59: real_content_type, ctype_attrs = parse_content_type(defaults)
This method takes the content_type of the message "text/html" and
splits the string so that variable real_content_type is "html". But
then on line 82 it calls;
82: part.set_content_type(real_content_type, nil, ctype_attrs)
def set_content_type( str, sub = nil, param = nil )
if sub
main, sub = str, sub
else
main, sub = str.split(%r</>, 2)
raise ArgumentError, "sub type missing: #{str.inspect}" unless
sub
end
if h = @h...
2006 Jan 25
2
how to define content charset?
I tried to define koi8-r charset in app/views/layouts/ like this:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<title>Cpu: <%= controller.action_name %></title>
<%= stylesheet_link_tag ''scaffold'' %>
</head>
But it doesn''t work. I suppose WEBrick already sent utf8 charset
2007 May 29
0
specs for ActionMailer
...fy do
before(:each) do
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries = []
@item = SitePage.new( :name => ''asdfasdf'')
@item.save!
@expected = TMail::Mail.new
@expected.set_content_type "text", "plain", { "charset" =>
CHARSET }
#@expected.set_content_type "multipart", "alternative",
{ "charset" => CHARSET }
@expected.mime_version = ''1.0''
@expected.from = ''jonathan at lin...
2006 Nov 01
2
How to: Individualized mass email with ActiveMailer - separate thread?
...#39;re using is basically placing
the following code in the controller:
email.people.each do |p|
# This generates a custom email for that person, with fields such as
[:name:]
# filled with the person''s name
raw_email = PeopleMailer.create_general_email(email, p, sent_at)
raw_email.set_content_type("text/html")
begin
PeopleMailer.deliver(raw_email)
rescue Exception => e
email.log += "\n" + format_time(Time.now) + "\n" + e.message + "\n"
end
end
The problem is that generating the 500 individual emails takes a
significant amount of time,...
2006 May 17
8
Html Email Problem
...the
confirm .html
In the mail i got total code same format what is the wrong
I am also sending the total code in the controller also.
order= Order.find_session(params[''ses_value''])
order = Order.find_by_name("admin")
email = OrderMailer.create_confirm(order)
email.set_content_type("text/html")
render(:text => "<pre>" + email.encoded + "</pre>")
OrderMailer.deliver_confirm(order)
I also saw the message i.e content type has changed to text/html
What is the problm I searching for solution since one month.
Please give me the refer...
2006 Aug 07
9
problems with ActionMailer
...ass):
def do_work(args)
@progress = 0
@logger.info("MAILER: starting job")
records = Record.find(:all)
total = records.size
records.each_with_index do |record, idx|
recipients = record.emails.to_a
email = Masivo.create_mail_prueba(recipients)
email.set_content_type("text/html")
Masivo.deliver(email)
sleep(10) # this is here for testing purposes
end
@logger.info("MAILER: job done")
@progress = 100
end
this is the code in Masivo:
def mail_prueba(recipients)
@recipients = recipients
@from = "myself a...
2006 Jul 19
7
Email Form for Contact Page
Can anyone point me to or provide me with code or a tutorial (preferably
a tutorial) for creating simple contact forms where the data is sent
over email to a specific email address. I have search all over the
internet and there doesn''t see to be anything anywhere.
Thanks In Advance,
Alex.
--
Posted via http://www.ruby-forum.com/.
2007 May 29
4
cache everything but...
I saw this older post when searching for information:
On Feb 16, 5:10 pm, Ingo Weiss <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> withfragmentcachingonecancacheparts of a page. However, more often
> than not what I would need is the exact opposite approach. I would like
> to be able to use action cashing and have a mechanism for telling Rails
> to
2006 Apr 27
11
Action Mailer Error!!!
What does this mean?
Bad file descriptor - connect(2)
--
Posted via http://www.ruby-forum.com/.
2006 Mar 01
0
Possible bug in ActionMailer (with patch)
...ms[:headers]. Unfortunately it
never seems to use them! I needed to add:
Index: action_mailer/part.rb
===================================================================
--- action_mailer/part.rb (revision 3679)
+++ action_mailer/part.rb (working copy)
@@ -96,7 +96,8 @@
part.set_content_type(content_type, nil, { "charset" => charset
}) if content_type =~ /multipart/
end
+ @headers.keys.each do |k| part[k] = @headers[k] end
part
end
Does this patch make sense? If not, what am I doing wrong? If so, who
would I submit it to?
Many thanks,
-elan
-...
2005 Feb 11
1
adding attachment to ActionMailer
Is it possible to add an attachment and send it with ActionMailer?
2005 May 03
0
ActionMailer w/ attachment
I am having trouble sending email w/ attachments as described in the
following how-to article:
http://wiki.rubyonrails.com/rails/show/HowToSendEmailsWithActionMailer
I can send basic emails successfully but the discussion regarding
attachments is giving me trouble.
mail.set_content_type(''multipart'', blah blah)
mail.parts << my_attachment
Questions:
1) Am I setting the content type for the attachment I am about to append?
2) What is "my_attachment" supposed to be, a file object?
Ultimately the script is failing at this portion of code with
everyt...
2009 Oct 28
2
How to send a html email with attachment
...ow
@body[:projects] = Project.all
attachment :content_type => "image/png",
:body => File.read(RAILS_ROOT + "/public/images/cancel.png")
end
views: just a erb file.
and the way I sent the mail is like below:
mail = MailReport.create_weekly_report
mail.set_content_type("text/html")
MailReport.deliver(mail)
If I sent it like that, I can not get the attachment insted of getting
some messy code.
I tried sent it like MailReport.deliver_weekly_report.
If so, the email will not be a html format email.
So what should I do, if I wanna send a html email wi...