On 18 September 2010 22:05, Marnen Laibow-Koser <[email protected]> wrote:
> nobosh wrote:
>> doesn't have a simpilar
>> way to comment things out in the view.
>
> Sure it does:
> <%# comment %>
That won't help him comment his <td> though...
> You should probably be using Haml instead of ERb, though.
Why? What failure is the OP experiencing that HAML would make succeed?
(BTW, I like HAML, but it's this sort of exclamation of yours without
any supporting citations that seems to rile people - try rephrasing
along the lines of "check out HAML for a more succinct and easier to
read way of rendering your views rather than using the bundled Erb"...
or something). If there's a method in HAML that would allow him to
comment his <td> without a lot of fussing, show that too, since that's
the problem he's facing.
Back to the OP:
I use a fairly straightforward way of removing code from execution, in
the view, model, controller, and in whatever language I happen to be
using - wrap it in a conditional check that doesn't return true:
<% if false %>
<td><%= link_to 'Destroy', project, :confirm => 'Are you
sure?', :method => :delete %></td>
<% end %>
Similarly, if you *never* want an existing conditional statement to pass, use:
<% if false && <your original condition here> %>
and if you *always* want it to pass:
<% if true || <your original condition here> %>
...easy to add and easy to remove.
--
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.