Tuesday, May 10, 2011

Re: [Rails] Re: each do js problem

On 10 May 2011 17:56, Neil Bye <lists@ruby-forum.com> wrote:
> Frederick Cheung wrote in post #997768:
>
>> Is this repeated for each comment? have multiple things on the page
>> with the same id is a no-no: ids should be unique
>>
>> Fred
>
>
> This is the full code
>
> <% @user.comments.each do |comment| %>
>   <div id="remark" ><p><%= comment.body %></p>
>     <div id="commenter"><p><%= comment.story_id %> <%= comment.id %>
>     </div>
>   </div>
>   <button>Hide</button>
>   <div id = "subcomNormal" >
>      <% comment.subcomments.each do |subcomment| %>
>         <div id="subremark" >
>           <p><%= subcomment.body %></p>
>         <div id="commenter" >
>          <p><%= subcomment.created_at %><%= subcomment.user_id %></p>
>         </div>
>         </div>
>     <% end %>
>   </div>
> <% end %>
>
> Yes it is repeated for all comments. Both comments and subcomments have
> individual id's I don't see you point.

To check whether your html is valid, view the page in the browser and
view the html using View >> Page Source (or similar). Then copy the
complete text and paste it into the w3c html validator.

Colin

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate