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.

I am having trouble find the answer that i need around partials for what
I need.
In my app I am displaying tabular data over many different controllers.
And I am displaying pagination links across the bottom of all of them.
I want to pull it out into a partial or a helper (not sure the best
here)
What I have currently looks like.
<div class="page_links" align="center">
<% if @payment_pages.page_count > 1 %>
<br /><br />Page: <%= link_to '<<-&nbsp;&nbsp;', { :page =>
@payment_pages.current.previous } if @payment_pages.current.previous %>
<%= pagination_links @payment_pages %>
<%= link_to '&nbsp;&nbsp;->>', { :page => @payment_pages.current.next }
if @payment_pages.current.next %>
<% end %>
</div>
I want to pull this out now into a place any view can use. But the
@payment_pages will obviously change based on what the controller is.
<%= render_collection_of_partials "partials/page_links", @payment_pages
%>
How would I go about doing this??
Thanks
Phillip

Phillip,
> I want to pull this out now into a place any view can use.
The standard way it to move your partial to a "shared" directory
../views/shared/_your_partial.rhtml
, and then in your controllers:
render :partial => "shared/your_partial"
--
Alain Ravet
--------
http://blog.ravet.com

Alain Ravet wrote:
> Phillip,>> > I want to pull this out now into a place any view can use.>> The standard way it to move your partial to a "shared" directory>> ../views/shared/_your_partial.rhtml>>> , and then in your controllers:> render :partial => "shared/your_partial"
Thanks.
My bigger question is how to pass the variables to it and have it
function properly.
Some pages my have @payment_pages that need to get passed another might
have @expenditure_pages for example.