> Not sure what you mean by conditionally... if it's something server
> side you could just do:
>
> <% if this_expression_evaluates_to_true %>
>    put your html here
> <% end %>

That is exactly what I'm talking about and it gives me a great basis
for trying to articulate what is confusing me.

I am apparently under the mistaken impression that when we insert into
an HTML document Ruby code that is included within <% %> like this:

<% ruby code %>

the inserted Ruby code is run at the point where it is inserted into
the HTML document.  When that Ruby code completes, any HTML code that
follows is sent to the requesting browser.  The point is that at any
given time either Ruby code is being run or HTML is being sent to the
requesting browser.  What your Ruby code does is interact with a
segment of HTML code so that that segment of HTML code is sent to the
browser conditionally.  That just blows my mind.  How are we able to
accomplish that?  Or, is that just something that I should accept and
try not to think about too much?  I would think that if we were going
to include content conditionally, that content would have to be within
the <% %> and quoted.  My concern is that I am missing some very
important point about <% %> that, if I weren't missing it, my
understanding would be a whole lot better.

> The way content_for works is to capture the result of the block
> (everything in b/n) and save it for later.

Yes.  I understand what content_for does.  I was just using it to
provide an example of the type of thing that I was talking about.

Thanks to all for the input.

         ... doug
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to