Thanks all, just a little surprised that Rails doesn't have a simpilar way to comment things out in the view.
On Sep 18, 10:57 am, Philip Hallstrom <[email protected]> wrote: > On Sep 18, 2010, at 10:50 AM, nobosh wrote: > > > Thanks for the reply. I need to avoid HTML comments. Also, I tried > > > <%= <td><%= link_to 'Destroy', project, :confirm => 'Are you > > > sure?', :method => :delete %></td> %> > > > And what happens is every time it runs through the loop it outputs on > > the page: </td> %>, meaning the " %> from the TD is being used to > > close the comment, which is why I'm trying to find out a way to > > comment this line out > > This is evil, but it will work... > > <%%q{ <td><%= link_to 'Destroy', project, :confirm => 'Are you > > sure?', :method => :delete %></td> }%> > > The %q{...} turns everything within it into an un-evaluated string. And the > <% without the <%= results in no output. If you don't even want the blank > line change the last %> to -%> > > -philip > > > > > Thanks > > > On Sep 18, 10:34 am, Philip Hallstrom <[email protected]> wrote: > >>> <% @projects.each do |project| %> > >>> <tr> > >>> . > >>> <td><%= link_to 'Destroy', project, :confirm => 'Are you > >>> sure?', :method => :delete %></td> > >>> . > >>> </tr> > >>> <% end %> > > >>> How can I safely comment out the TD line above? Do I have to use the > >>> =begin way? > > >> If you don't mind HTML comments, just wrap it in <!-- ..... -> > > >> If you just want the link gone, but keep the <td> you can make the start > >> tag look like <%#= and it should work (if memory serves). > > > -- > > 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 > > athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- 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.

