Created
August 14, 2008 15:07
-
-
Save foca/5442 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
%ul | |
- for activity in @user.activity_feed | |
%li= render :partial => "activity", :object => activity |
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
def render_activity(activity) | |
partial = case activity.activity_type | |
when :comment then "activities/comment" | |
else "activities/generic" | |
end | |
render :partial => partial, :object => activity | |
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
%ul | |
- for activity in @user.activity_feed | |
%li= render_activity(activity) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment