Forum: Ruby on Rails Using view from different controller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Christoph K. (Guest)
on 2008-10-19 01:36
Hi,
I (newbie) work on an application that uses the last.fm api and request
the top albums from Last.fm.

so I have a lastfm_controller with the action
caches_view: top_albums

def top_albums
   get_albums(params[artist])
  #gets top albums from
end

and a top_albums.rhtml that renders a list of the albums. I want to
cache the view, what works well.

Now i have another mediaplayer_controller that gets the current artist
from my media player.

def get_mediaplayer_artist
  @artist = getmediaplayer.artist
end

In the mediaplayer.rhtml I want to include lastfm functionality.
How can I include the /lastfm/top_albums/ARTIST view in the
mediaplayer.rhtml.

I tried to move everything to the mediaplayer_controller, and use the
render call, however then I have no caching.

I hope its understandable. My main problem is that I need the caching
functionality of the lastfm actions.

thanks
This topic is locked and can not be replied to.