We were using similar code in four different places; six, if we count the welcome pages seeds. Reducing duplication in the pages seeds is a bit tricky because administrators are supposed to edit their content and might remove the HTML class we use to define styles. However, we can share the code everywhere else. Note that there's a bug in the application since we show that level 2 users cannot vote for budget projects but we give them permission to do so in the abilities model. We're keeping the same behavior after this refactoring but we might change it in the future.
6 lines
123 B
Plaintext
6 lines
123 B
Plaintext
<div class="user-permissions">
|
|
<p><%= message %></p>
|
|
|
|
<%= render Account::PermissionsListComponent.new(user) %>
|
|
</div>
|