Created
November 15, 2012 20:06
-
-
Save rodrigopinto/4080912 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Game | |
| #... | |
| def print_average_game_rating | |
| if ratings_count == 0 | |
| "Nota média:" | |
| else | |
| "Nota média: #{average_game_rating}" | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 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... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 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