SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sharing partials

    Hi guys,
    simple question (this time): is it possible to share some partials between views ???

    I have a couple of partial that I would like to use in different views (the views are not on the same folder)

    I tried to put the partials on views/layouts but it doesn't work.


    THANK YOU
    Alla prossima ...

  2. #2
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    directory:
    - views/
    -- model_a/
    --- _partial_a.rthml
    -- model_b/
    --- some_page.rhtml

    in some_page.rhtml you can call
    <%= render :partial '/model_a/partial_a' %>

    cheers
    If you give someone a program,
    you will frustrate them for a day;
    if you teach them how to program,
    you will frustrate them for a lifetime.

  3. #3
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank buddy !!!

    have a good day!
    Alla prossima ...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •