Forum: Ruby on Rails render action in rails 2.3

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.
F9d6c4b25299a8dacf69b58583d34b39?d=identicon&s=25 Zeljko Dakic (Guest)
on 2009-03-15 12:19
(Received via mailing list)
Hi,

I might be out of touch with latest features in rails or this might be
just simple error on my part. I can't get this to work in site layout:
<div id="footerWrapper">
  <%= render :controller => 'site', :action => "footer" %>
</div> <!-- footerWrapper -->

I need to list some links in footer and that is why I need this in
layout. If this for some reason isn't working any more, can you please
suggest any alternative approach.

Thanks for all the help.

Zeljko
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-03-15 12:46
(Received via mailing list)
don't you just want to render a template like this:
  <%= render "shared/footer" %>

?
872535e214a9e3a98889bd8d069f0294?d=identicon&s=25 "Wolas!" (Guest)
on 2009-03-16 12:24
(Received via mailing list)
In application.rb you will need to get all footers and ut them in a
variable.

class AC

    before_filter :get_footer

    def get_footer
       @links = FooterLinks.all
    end
end

in your layout you can either put directly like:

- for link in @links do
  = link_to link.name, link.path

or put it in a partial and call it from the layout

= render :partial => "footer"
This topic is locked and can not be replied to.