I have a user controller which consists of a method named listfolders().
class UserController < ApplicationController
def myaccount()
userId = session[:id]
@listfolders = UsersFolders.listfolders(userId)
@users = User.listusers()
end
end
In the views I have and I’m able to fetch the folders:
<% @listfolders.each do |userfolder| %>
<tr>
<td><a href="#" target="cstr"><b><%= userfolder.foldername %></b></a></td>
</tr>
<% end %>
PROBLEM: I want to display the folders in all pages like compose,drafs,trash etc … instead of just for the action.
How can I do it ?
The basic, standard way to do this would be in a helper.
then in app/views/users_folders/_listfolders.html.erb
calling it is as easy as: