-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Option For Single View Template Shared Between Trackables #124
Comments
That is a good idea, thanks @1ndivisible. For now you can use the (undocumented) param render_activities(@activities, display: 'generic') which will use the partial in
|
Thanks. This is better, but this doesn't allow for CRUD-specific views(_create.html, _destoy.htnl.erb, update.html.erb), or am I missing something. Obviously I can just use logic in |
Quick fix: In
In helper:
Then in
|
It would be better to use something like <%= render_activity activity, display: public_activity_view_for_key(activity.key)%> Just to have all locals there, instead of just |
It will be almost perfect if we can add generic template lookup if no dedicated partial found. |
@iRet that is a good idea. I will be reworking template system for activities for the 2.0 version. |
Just chiming in to see how this is progressing? 😊 |
Currently Public Activity forces a discrete set of views for every Trackable type. In my current project I am using Public Activity to display a simple feed in a CMS. There are 20 separate models, all of which are trackable, and the only thing I want to display is the time the resource was updated/created, a link to the resource, an icon for the resource type and a title. All these resources implement
to_title
, so I can use the exact same views for every resource. However Public Activity doesn't allow for this. My only option is to duplicate the exact same views for every resource type.Please implement some kind of fallback in how Public Activity looks for views. It could start by looking for Model-specific views, then fall back to generic views, much as Rails partials fall back to partials created for a parent controller.
The text was updated successfully, but these errors were encountered: