Hi I have this list page that has some rjs templates updating parts of
it including a table of results. i''m trying to put pagination on the
table. thing is lots of different actions update the table and they have
their own paginators.
anyway i have this code at the bottom which worked for another page
<% pagination_links_each(@offer_pages,:window_size =>4) do |n|
"<a href=\"#\" onclick=\"new
Ajax.Request(''/user/choose_offer?page=#{n}'',
{asynchronous:true,
evalScripts:true}); return false;\">#{n}</a>"
end
%>
but i need to right it so that the calling action is substituted into
where choose offer is now...
so how do i get the name of the action that rendered the page?
Just starting out with rails so forgive me if this code looks horrible.
thanks in advance
c
--
Posted via http://www.ruby-forum.com/.
Peter Michaux
2006-Jul-22 15:57 UTC
[Rails] How do you find out what action rendered a page
I have the following in one of my layout head sections
<%=
"admin::#{controller.controller_name}::#{controller.action_name}"
%>
That might get you started.
Peter
On 7/22/06, ghost <waspfactory@ggggmmmmmail.com>
wrote:> Hi I have this list page that has some rjs templates updating parts of
> it including a table of results. i''m trying to put pagination on
the
> table. thing is lots of different actions update the table and they have
> their own paginators.
>
> anyway i have this code at the bottom which worked for another page
>
> <%> pagination_links_each(@offer_pages,:window_size
=>4) do |n|
> "<a href=\"#\" onclick=\"new
> Ajax.Request(''/user/choose_offer?page=#{n}'',
{asynchronous:true,
> evalScripts:true}); return false;\">#{n}</a>"
>
>
> end
> %>
>
> but i need to right it so that the calling action is substituted into
> where choose offer is now...
>
> so how do i get the name of the action that rendered the page?
>
> Just starting out with rails so forgive me if this code looks horrible.
> thanks in advance
> c
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Thanks peter, thats exactly what i wanted. -- Posted via http://www.ruby-forum.com/.
Dion Hewson
2006-Jul-22 17:40 UTC
[Rails] Re: How do you find out what action rendered a page
I run the plugin query_trace and tail -f the logs its handy as pie and requires nothing to be inserted into your code On 7/23/06, ghost <waspfactory@ggggmmmmmail.com> wrote:> > Thanks peter, thats exactly what i wanted. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060722/e1f8e426/attachment.html