Mamadou Touré wrote:
> 
>> 
>> This should work.  In fact, it sounds like it *is* working -- it's 
>> sending the text to the browser just like it should.  What it may not be 
>> doing properly is setting the MIME type.  Can you check the MIME type of 
>> the response?
>> 
>>> 
>>>   end
>> 
>> Best,
>> --
>> Marnen Laibow-Koser
>> http://www.marnen.org
>> [email protected]
> 
> Thanks a lot for the code review. I'm new in Ruby (coming from an AS/400 
> background)

AS/400 isn't a language...

(FWIW, my first professional programming job was working in RPG on an 
AS/400.  I'm better now, thanks. :) )

> , that's why I just ''copy-paste'' code from other ruby 
> application.

Ooooh.  That's really bad.  You need to learn the basics of the language 
a bit better, I think.

> 
> The Mime-type is text/javascript, and I think this one is obsolete , and 
> I want to  set my response Mime-type to 'application/javascript'', how 
> to do that ? should I add it to render :js => "alert('Test !');" ?

You don't want to do that.  Check out 
http://krijnhoetmer.nl/stuff/javascript/mime-types/ : 
application/javascript is only recognized by a few browsers. 
text/javascript is the best understood type.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to