Comment for partial line

X

Xia __

Hi

Can someone confirm that Ruby only allows #tail of line commenting and
=begin
this
whole
block
commenting
=end


and not <some comment syntax here>partial line <end comment
syntax>commenting?

and if so, i request this be changed! its really annoying not being able
to do a partial line comment in rhtml

thanks
 
J

Jeremy McAnally

You can do HTML comments in RHTML you know. ;)

--Jeremy

Hi

Can someone confirm that Ruby only allows #tail of line commenting and
=begin
this
whole
block
commenting
=end


and not <some comment syntax here>partial line <end comment
syntax>commenting?

and if so, i request this be changed! its really annoying not being able
to do a partial line comment in rhtml

thanks


--
http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
 
M

Michael Fellinger

Either, <!-- this commet style -->
or...

<% do_stuff; "comment on it"; do_more; "more comments" %>

but please, if you need to document a template... move that stuff into
the controller...
 
X

Xia __

its more for bug tracking; to be able to remove functionality
temporarily to see what is broken, so more like

<% do_stuff; /* HIDE THE FOLLOWING FROM RUBY do_more; */ %>
 
M

Marcello Barnaba

its more for bug tracking; to be able to remove functionality
temporarily to see what is broken, so more like

<% do_stuff; /* HIDE THE FOLLOWING FROM RUBY do_more; */ %>

that means that perhaps you have way too much logic in your template, and you
should better move that logic into the controller. it isn't just a matter of
taste, it's a matter of good design :).

HTH
 
X

Xia __

i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.
 
M

Michael Fellinger

i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.

no.
 
X

Xia __

Michael said:

cool thanks michael.

i think there may be some argument for it to be supported in the case of
erb in rhtml; mostly due to common html markup style which is different
to ruby due to line spacing and inline elements in html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,232
Messages
2,571,168
Members
47,803
Latest member
ShaunaSode

Latest Threads

Top