SSI like function in Rails?


#1

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


#2

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 removed_email_address@domain.invalid wrote:

handle them properly (at all).

// Daniel


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


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

  • J *
    ~

#3

Great, thank you very much!

// Daniel