RJS templates, how to call a method from a specific controller?


I have User and Photo controllers and models.

the user has many photos
photos belongs to the user

In a user profile section i have a photo gallery using RJS.


I’m on user controller, and the logic of ‘photos’ are on photos
how can i call the RJS template using logic from another controller (in
case photo)?

at user controller:
page.replace_html('html_id, :partial => ‘photo’)

at photo.html.erb

here i need put a lot of logic from the photo controller, how can i
use a
method from it?

Thank your very much for the attention!


Luiz Vitor Martinez C.
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br

Hey, maybe you’re looking for:

redirect_to :controller => :controller-name, :action => :action-name

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs