Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Created November 15, 2012 20:06
Show Gist options
  • Save rodrigopinto/4080912 to your computer and use it in GitHub Desktop.
Save rodrigopinto/4080912 to your computer and use it in GitHub Desktop.
class Game
#...
def print_average_game_rating
if ratings_count == 0
"Nota média:"
else
"Nota média: #{average_game_rating}"
end
end
end
- if timeline_activities
- timeline_activities.each do |activity|
- if activity.class == Playable
- @user ? user = @user : user = activity.user
- @game ? game = @game : game = activity.game
= render "playables/timeline_activity", activity: activity, user: user, game: game
- if activity.class == Message
= render "messages/timeline_activity", activity: activity, author: activity.author, messageable: activity.messageable
- if paginated
#load-more
- load_more_url = user_profile_path(@user.slug, pagina: (@page.to_i+1)) if @user
- load_more_url = game_path(slug: @game.slug, platform: @game.platform, pagina: (@page.to_i+1)) if @game
= link_to load_more_url, title: "Ver mais ativididades", remote: true, format: :js, id: "load-more-button" do
ver mais atividades
%span.green-symbol
= "+"
= image_tag "loading3.png", :alt => "Carregando...", :class => "loading"
- else
%p Nenhuma atividade foi registrada por aqui ainda...
- if timeline_activities
= activity_decorator.timeline_activity
- if paginated
#load-more
- load_more_url = user_profile_path(@user.slug, pagina: (@page.to_i+1)) if @user
- load_more_url = game_path(slug: @game.slug, platform: @game.platform, pagina: (@page.to_i+1)) if @game
= link_to load_more_url, title: "Ver mais ativididades", remote: true, format: :js, id: "load-more-button" do
ver mais atividades
%span.green-symbol
= "+"
= image_tag "loading3.png", :alt => "Carregando...", :class => "loading"
- else
%p Nenhuma atividade foi registrada por aqui ainda...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment