Daniel Higginbotham
2007-Jan-12 14:53 UTC
component like behavior with nested restful routes in beast
I''m using beast, which has routes that look like this:
map.resources :forums do |forum|
forum.resources :topics do |topic|
topic.resources :posts, :monitorships
end
end
I want an action from another controller to display the content that
would be displayed if I navigated to, for example, /forums/1/topics/2 ,
along with other content not normally displayed by that action. Is this
possible? I tried using render_component, but some of the instance
variables in TopicsController.show could not be set properly.
Thanks
Daniel
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Daniel Higginbotham
2007-Jan-12 20:27 UTC
Re: component like behavior with nested restful routes in beast
Anybody? Daniel Higginbotham wrote:> I''m using beast, which has routes that look like this: > > map.resources :forums do |forum| > forum.resources :topics do |topic| > topic.resources :posts, :monitorships > end > end > > I want an action from another controller to display the content that > would be displayed if I navigated to, for example, /forums/1/topics/2 , > along with other content not normally displayed by that action. Is this > possible? I tried using render_component, but some of the instance > variables in TopicsController.show could not be set properly. > > Thanks > Daniel > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I use a helper to replace render component;
not sure is it helpful for you.
def render_remote(url, view = ''remote'')
options = {}
options[:update] = view
options[:url] = url
options[:method] = :get
render :inline => %{<span
id="#{view}"><p>Loading...</p><script
type="text/javascript"
language="JavaScript">#{remote_function(options)}</script></span>}
end
herngwah
On Jan 13, 4:27 am, Daniel Higginbotham
<dan...-4cOk6EWy6wjNj93mkU9IYrqjc7CnNF17@public.gmane.org>
wrote:> Anybody?
>
> Daniel Higginbotham wrote:
> > I''m using beast, which has routes that look like this:
>
> > map.resources :forums do |forum|
> > forum.resources :topics do |topic|
> > topic.resources :posts, :monitorships
> > end
> > end
>
> > I want an action from another controller to display the content that
> > would be displayed if I navigated to, for example, /forums/1/topics/2
,
> > along with other content not normally displayed by that action. Is
this
> > possible? I tried using render_component, but some of the instance
> > variables in TopicsController.show could not be set properly.
>
> > Thanks
> > Daniel
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---