Forum: Ruby on Rails SSI like function in Rails?

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.
6738e5c4f17822f7e163ba938344755d?d=identicon&s=25 Daniel (Guest)
on 2006-02-25 12:46
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
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-02-25 12:54
(Received via mailing list)
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:
> 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 *
  ~
6738e5c4f17822f7e163ba938344755d?d=identicon&s=25 Daniel (Guest)
on 2006-02-25 12:58
Great, thank you very much!


// Daniel
This topic is locked and can not be replied to.