ruby on rails - Kaminari and extra params -
I have looked around and I can not find anything near the answer. I think this is a very unique issue, although I am not surprised.
I have an index page, where I am showing all the leads, but I have 3 different ways to show it: without review, review, all. Do I use current_page to accomplish this? Helpful, add:? Unreviewed = Correct for URL
This is not a problem in its own right, when I add it to the comer for the pager, the page parameters are disturbed and make it the current page?
How can I decide, or is there a better way to accomplish this goal?
This is using Rail 4 and Kamarini 0.15.1
Controller:
DIF index @ lilus = lead. Order (: ID). Page Params [: Page] @reviewed_leads = Lead. Where (reviewed: true) .order (id). Page Params [: page] @edit_lades = leads. Where (reviewed: zero) .order (: id). Page Params [: Page] current_page_no = lead.page end
Index.html.erb
& lt; Tr & gt; & Lt; Td colspan = "7" style = "text-align: center;" & Gt; & Lt; Div class = "endorsing page calculation-table" & gt; & Lt;% if current_page? (Controller: 'clue', verb: 'index', not reviewed: 'true')%> & Lt;% = paginate @ reviewed_leads% & gt; & Lt;% elsif current_page? (Controller: 'Clue', Action: 'Index', Reviewed: 'Correct')%> & Lt;% = Pagenet @ reviewed_lades% & gt; & Lt;% else% & gt; & Lt;% = Pagnet @ Leds% & gt; & Lt;% end% & gt; & Lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt;
This looks like a URL when used:
/ off / off / unseen = true
< P> In this way with this, current_page is not reading it correctly and it is always showing light examples @ > Any help will be greatly appreciated. I am going to continue trying things, I will update with what I look for.
Change your administrator action to
you do not need to check the current page, just make sure that you pass by the value of
Param [[reviewed]]
& lt;% = paginate @ lightweight, parameter: {review: the ultimate [: reviewed}}%> As mentioned in the comments, it does not work to show mixed leads.
UPDATE
This can be achieved by creating a scope
# lead model def self.filter_by_reviewed_status (status) case condition when zero is scoded when 'true' then (where reviewed: Correct) when 'false' then
@leads = lead .filter_by_reviewed_status (params [...]
parameter [: reviewed]
or So make sure to false, falseor
leads
you