@@ -132,33 +132,10 @@ follows:
132
132
133
133
<%= erb :mypartial, :layout => false %>
134
134
135
- See [ Sam Elliott] ( http://www.lenary.co.uk/ ) and [ Iain Barnett] ( http://iainbarnett.me.uk/ ) 's
136
- [ Sinatra-Partial extension] ( https://github.com/yb66/Sinatra-Partial )
137
- for a more robust partials implementation. It also supports rendering
138
- collections and partials in subdirectories.
139
-
140
- The code used to live in a [ gist] ( https://gist.github.com/119874 ) ,
141
- but we have put it in a gem so we can maintain it properly and
142
- provide an easier way for developers to include its behaviour.
143
- It was adapted from [ Chris Schneider] ( http://www.gittr.com/ ) 's
144
- original [ partials.rb] ( https://github.com/cschneid/irclogger/blob/master/lib/partials.rb )
145
- implementation.
146
-
147
- Use it as follows to render the ` mypartial.haml ` (1) or the ` admin/mypartial.haml ` (2)
148
- partials, or with a collection (3) & (4):
149
-
150
- <%= partial(:mypartial) %> <!--(1)-->
151
- <%= partial(:'admin/mypartial') %> <!--(2)-->
152
- <%= partial(:object, :collection => @objects) %> <!--(3)-->
153
- <%= partial(:'admin/object', :collection => @objects) %> <!--(4)-->
154
-
155
- In (1) & (2), the partial will be rendered plain from their files, with no
156
- local variables (specify them with a hash passed into ` :locals ` ).
157
- In (3) & (4), the partials will be rendered, populating the local
158
- variable ` object ` with each of the objects from the collection.
159
-
160
- It is also possible to enable using underscores, a la Rails, and
161
- to choose a different rendering engine from haml.
135
+ If you are interested in more robust partials solutions, check out the
136
+ [ sinatra-recipes project] ( http://recipes.sinatrarb.com/ ) , which has articles on
137
+ using the [ sinatra-partial gem] ( http://recipes.sinatrarb.com/p/helpers/partials_using_the_sinatra-partial_gem?#article ) or
138
+ [ implementing your own Rails-style patrials] ( http://recipes.sinatrarb.com/p/helpers/partials?#article ) .
162
139
163
140
164
141
Can I have multiple URLs trigger the same route/handler? {#multiroute}
0 commit comments