I have a page that I want to use data from several tables. I wanted to split these into their own div''s but I do not know how to access the different part''s controllers. There are seperrate controllers because I developed the parts seperately. Has anyone done this? Thanks! -- Posted via http://www.ruby-forum.com/.
Look at render_component on api.rubyonrails.com or you could make partials of the tables and render them accordingly. Roland -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/9f7163d8/attachment.html
Render_component should be avoided. We are being encouraged to use partials and helpers. On 8/4/06, Roland Mai <roland.mai@gmail.com> wrote:> > Look at render_component on api.rubyonrails.com or you could make partials > of the tables and render them accordingly. > > Roland > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/12637505/attachment.html
Sébastien Boisvert
2006-Aug-04 17:41 UTC
[Rails] Using multiple controllers within the same page
You can do this with AJAX :
# in application_helper.rb
def into_div options={}
"<script>
new Ajax.Updater( ''#{options[:update]}'',''#{url_for
options[:url]}'',
{asynchronous:true, evalScripts:true})
</script>"
end
# Then, in the view you want to show some view of another controller :
<div id="my_div"></div>
<%= into_div :update=>
:my_div,:url=>{:controller=>''controller_x'',:action=>:abc
%>
# maybe I misunderstood your question, anyway......
>
> Message: 2
> Date: Fri, 4 Aug 2006 18:38:21 +0200
> From: Andrew <ski_abn@hotmail.com>
> Subject: [Rails] Using multiple controllers within the same page
> To: rails@lists.rubyonrails.org
> Message-ID: <6867798e252853a1d55c199642cb5032@ruby-forum.com>
> Content-Type: text/plain; charset=utf-8
>
> I have a page that I want to use data from several tables. I wanted to
> split these into their own div''s but I do not know how to access
the
> different part''s controllers. There are seperrate controllers
because I
> developed the parts seperately.
>
> Has anyone done this?
>
> Thanks!
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
> ------------------------------