Skip to content

Commit

Permalink
Merge pull request public-activity#230 from maxcodes/mh-fix-documenta…
Browse files Browse the repository at this point in the history
…tion

Add HTML to examples in Readme.
  • Loading branch information
pokonski committed Sep 6, 2015
2 parents 31c2bd5 + f5bb913 commit a046a66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ like a timestamp, owner's avatar etc:
<%= render_activities(@activities, layout: :activity) %>
```

The activity will be wrapped with the `app/views/layouts/_activity.erb` layout, in the above example.
The activity will be wrapped with the `app/views/layouts/_activity.html.erb` layout, in the above example.

**Important**: please note that layouts for activities are also partials. Hence the `_` prefix.

Expand All @@ -196,7 +196,7 @@ Sometimes, it's desirable to pass additional local variables to partials. It can

`public_activity` looks for views in `app/views/public_activity`.

For example, if you have an activity with `:key` set to `"activity.user.changed_avatar"`, the gem will look for a partial in `app/views/public_activity/user/_changed_avatar.(erb|haml|slim|something_else)`.
For example, if you have an activity with `:key` set to `"activity.user.changed_avatar"`, the gem will look for a partial in `app/views/public_activity/user/_changed_avatar.html.(|erb|haml|slim|something_else)`.

*Hint*: the `"activity."` prefix in `:key` is completely optional and kept for backwards compatibility, you can skip it in new projects.

Expand All @@ -206,7 +206,7 @@ If you would like to fallback to a partial, you can utilize the `fallback` param
<%= render_activity(@activity, fallback: 'default') %>
```

When used in this manner, if a partial with the specified `:key` cannot be located it will use the partial defined in the `fallback` instead. In the example above this would resolve to `public_activity/_default.(erb|haml|slim|something_else)`.
When used in this manner, if a partial with the specified `:key` cannot be located it will use the partial defined in the `fallback` instead. In the example above this would resolve to `public_activity/_default.html.(|erb|haml|slim|something_else)`.

If a view file does not exist then ActionView::MisingTemplate will be raised. If you wish to fallback to the old behaviour and use an i18n based translation in this situation you can specify a `:fallback` parameter of `text` to fallback to this mechanism like such:

Expand Down

0 comments on commit a046a66

Please sign in to comment.