1 Replies - 614 Views - Last Post: 27 April 2014 - 06:23 PM Rate Topic: -----

#1 samarfikri  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-April 14

Can someone please explain what this code does exactly?

Posted 27 April 2014 - 06:14 PM

[color="#000000"][b]<html>

<h1> Group Page </h1>

  <% @lik.each do |c| %> 

  <%c = c[1]%>

  <%v = c[1]%>
  <%v.likable_id%><br><br>
  <%if v.likable_type == "comment"%>
<%#=  c.last().last().likable_id%>

    <% if v.likable_id != nil %>

      <%@comm =Comment.find(v.likable_id)%> 
      <br><%= @comm.comment%>	

      <% @count = 0%>
      <%if c!= nil %>
        <% c.each do |cou|%>
        <%@count = @count +1%>
      <%end%>
      <br><%= @count%> likes
      <a href ="like?currentcontrol=likes&currentaction=showposts&type='comment'&likable=<%= @comm.id%> " > <button> like</button> </a>
    <%end%>

  <%end%>
  <%else%>
  <% if v.likable_id != nil %>
    <%@comm =Post.find(v.likable_id)%> 
    <br><%= @comm.post%>

    <% @count = 0%>
      <%if c!= nil %>
        <% c.each do |cou|%>
        <%@count = @count +1%>
      <%end%>
      <%= @count%> likes
      <a href ="like?currentcontrol=likes&currentaction=showposts&type='post'&likable=<%= @comm.id%> " > <button> like</button> </a>
  <%end%>

    <%end%>
<%#= posts.find(c.id).post%><br><br>
      <%end%>
  <%end%>

</html>[/b][/color]


This post has been edited by xclite: 27 April 2014 - 06:19 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Can someone please explain what this code does exactly?

#2 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: Can someone please explain what this code does exactly?

Posted 27 April 2014 - 06:23 PM

Please use code tags when posting.

Additionally, what is your specific question? Do you have any thoughts on how it does work? We'd prefer if you didn't post several topics with the goal of having somebody explain each line of code to you as you encounter new things.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1