You want to learn about ''partials''
app/views/shared/_header.rhtml:
<h1>My Great Site!</h1>
app/views/layouts/application.rhtml:
<html><body>
<%= render_partial ''shared/header'' %>
</body></html>
.... basically like that.
- james
On 2/25/06, Daniel <big@chello.se> wrote:> Hey
>
> Im slowly learning ruby and rails... still having some problems with
> grasping the basic concepts though.
>
> How do I include a common html snippet in some of my views? (The snippet
> exists in two different flavors, I want to include either one depending
> on what type of user (admin/others) is requesting the page)
>
> I have tried the normal SSI include tags, but my WEBrick server cant
> handle them properly (at all).
>
> // Daniel
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
* J *
~