Doug,
I recall I went through a similar 'wow' experience, and it helped me
sort out how this was working when I realised I could think of <% and
%> in the reverse of the way they are normally presented.
By that I mean, insted of seeing a <% %> pair as bracketing ruby code
embedded in the middle
On Jun 21, 2009, at 9:48 AM, Marnen Laibow-Koser
wrote:
>
> Tonypm wrote:
>> steve
>>
>> that's the first outline of erb I have seen.
Glad to be of help.
>>
>
> Yes, thanks for that. I know intuitively how ERb works, but had never
> looked at the internals in any detail.
>
> [...]
>> I
>> u
Tonypm wrote:
> steve
>
> that's the first outline of erb I have seen.
Yes, thanks for that. I know intuitively how ERb works, but had never
looked at the internals in any detail.
[...]
> I
> use haml, and I have often wondered how it hooks into erb.
As far as I know, it doesn't (unless yo
steve
that's the first outline of erb I have seen. Either it doesn't get
discussed a lot, or it is discussed in places I don't visit. Anyway,
although I had a broad idea of what was going on under the bonnet, I
had never really seen a clear example of an erb template in action. I
use haml, and
> "_erbout = ''
> _erbout.concat \"This is plain text\\n\"\n_erbout.concat \"And the
> time is \"
> _erbout.concat(( Time.now ).to_s)
> _erbout.concat \"\\n\"\n
> if true
>_erbout.concat \"\\n\"\n_erbout.concat \" it was true\\n\"\n
> else
>_erbout.concat \"\\n\"\n_erbout.concat \" it wa
On Jun 19, 2009, at 11:51 AM, djolley wrote:
>
> Thanks so much for your kind explanation. Unfortunately, it still
> doesn't make sense to me.
>
> The documentation for the ERB class tells us:
>
> <% Ruby code -- inline with output %>
> <%= Ruby expression -- replace with result %>
>
> That make
2009/6/19 djolley :
>
> Thanks so much for your kind explanation. Unfortunately, it still
> doesn't make sense to me.
>
> The documentation for the ERB class tells us:
>
> <% Ruby code -- inline with output %>
> <%= Ruby expression -- replace with result %>
>
> That makes perfect sense. The docu
Thanks so much for your kind explanation. Unfortunately, it still
doesn't make sense to me.
The documentation for the ERB class tells us:
<% Ruby code -- inline with output %>
<%= Ruby expression -- replace with result %>
That makes perfect sense. The documentation even alludes to the
capabil
On Jun 18, 2009, at 10:03 PM, djolley wrote:
>
>> 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
> 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
2009/6/18 doug :
>
> I have seen a number of examples where HTML code is treated as a Ruby
> block. For example, here is one taken from the Agile Rails book:
>
> <% content_for( :sidebar) do %>
>
> this text will be rendered
> and saved for later
> it may contain <%= "dynamic" %>
On Jun 18, 8:27 pm, doug wrote:
> I have seen a number of examples where HTML code is treated as a Ruby
> block. For example, here is one taken from the Agile Rails book:
>
> <% content_for( :sidebar) do %>
>
> this text will be rendered
> and saved for later
> it may conta
> I have seen a number of examples where HTML code is treated as a Ruby
> block. For example, here is one taken from the Agile Rails book:
>
> <% content_for( :sidebar) do %>
>
> this text will be rendered
> and saved for later
> it may contain <%= "dynamic" %> stuff
>
> <% end %
13 matches
Mail list logo