On Jun 16, 2011, at 3:00 PM, Xavier Noria wrote:
On Thu, Jun 16, 2011 at 8:45 PM, steveluscher
<[email protected]> wrote:
There's a discussion going on at StackOverflow about whether, with
the
advent of HTTP streaming in Rails 3.1, it's time to bend the rules
with respect to the time honoured tradition of putting <script> tags
before the closing </body> tag.
http://stackoverflow.com/questions/6116436/rails-3-1-http-streaming-js-in-head-or-bottom-of-body/6376719#6376719
For the general case, I think unfortunately they are still going to go
to the bottom. Reason is Safari for Mac buffers 1024 bytes before it
starts to issue requests for assets (and Safari for iPhone and iPad
buffer 512 bytes).
Since the head of a document is typically smaller, Safari users would
still get the ordinary bad experience.
Firefox, Opera, and IE8 do not buffer, and Chrome buffers 252 bytes,
according to some test I've done together with Hongli Lai.
Has Rails changed the order in which it does things??
* instantiate a controller object and call the appropriate action method
* render a view (and its partials, etc)
* grab the layout and build the page by interpolating the various
content_for bits and the main render content where there are yield's
* return the whole thing as the response
How can you get the <head> from the layout first? What if a
'yield :head_stuff' is encountered?
-Rob
P.S. I haven't played with 3.1 yet and wasn't at RailsConf to hear any
related talks.
Rob Biedenharn
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.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.