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 of
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,
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 you
On Jun 21, 2009, at 9:48 AM, Marnen Laibow-Koser
rails-mailing-l...@andreas-s.net
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
_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 wasn't true\\n\\n
end
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
capability
2009/6/19 djolley ddjol...@gmail.com:
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
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 makes perfect
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 %
ul
lithis text will be rendered/li
liand saved for later/li
liit may contain %= dynamic % stuff/li
/ul
%
On Jun 18, 8:27 pm, doug ddjol...@gmail.com 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 %
ul
lithis text will be rendered/li
liand saved for
2009/6/18 doug ddjol...@gmail.com:
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 %
ul
lithis text will be rendered/li
liand saved for later/li
liit may
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
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 basis
for trying
13 matches
Mail list logo