SSI like function in Rails?

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

You want to learn about ‘partials’

app/views/shared/_header.rhtml:

My Great Site!

app/views/layouts/application.rhtml:

<%= render_partial 'shared/header' %>

… basically like that.

  • james

On 2/25/06, Daniel [email protected] wrote:

handle them properly (at all).

// Daniel


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

  • J *
    ~

Great, thank you very much!

// Daniel