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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by Luiz Vitor Martinez Cardoso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah,

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.

Well,

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

at user controller:
jphoto.rjs
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!

--
Regards,

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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


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

by Jason Lillywhite-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey, maybe you're looking for:

redirect_to :controller => :controller-name, :action => :action-name
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!