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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
don''t you just want to render a template like this: <%= render "shared/footer" %> ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
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"
On Mar 15, 8:22 am, Zeljko Dakic
<zel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---