ChiliProject is not maintained anymore.
Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and
we urge all existing users to migrate their data to a maintained
system, e.g. Redmine. We will
provide a migration script later. In the meantime, you can use the
instructions by
Christian Daehn.
Forums » Discuss »
Pagination in plugins; and Bundle / Gem issues...
Added by Nick Peelman at 2011-07-15 05:26 pm
These two are interrelated in terms of the problems i encountered, so bear with me...
First off...
Is there an "official" way that plugins should be hooking into to allow pagination? The plugin in question Departments currently uses will_paginate with much success. I'm curious if there is a better /easier / more 'official' way since will_paginate is not used anywhere else within Chili.
Secondly...
In order to get will_paginate to load and be recognized, I had to add it to Gempack and re-run `bundle install` in order to make it happy. Is there something I'm doing wrong here that can be corrected so that my require will_paginate
won't piss off Passenger for anybody who doesn't go through that?
`bundle install` didn't actually need to install will_paginate, since i had already installed it, but I'm assuming its doing something to link it or whatever so that Chili knows where to look? Forgive my ignorance of Bundle, somehow I've managed to get by without dealing with it so far, and I've been out of the Ruby game for several months now :-(
Nick Peelman wrote:
Is there an "official" way that plugins should be hooking into to allow pagination? The plugin in question Departments currently uses will_paginate with much success. I'm curious if there is a better /easier / more 'official' way since will_paginate is not used anywhere else within Chili.
There's a Paginator
and some helpers in ChiliProject, see source:/app/controllers/issues_controller.rb#L68 for a bit using it, not sure how "state of the art" it is though.
In order to get will_paginate to load and be recognized, I had to add it to Gempack and re-run `bundle install` in order to make it happy. Is there something I'm doing wrong here that can be corrected so that my require will_paginate
won't piss off Passenger for anybody who doesn't go through that?
`bundle install` didn't actually need to install will_paginate, since i had already installed it, but I'm assuming its doing something to link it or whatever so that Chili knows where to look? Forgive my ignorance of Bundle, somehow I've managed to get by without dealing with it so far, and I've been out of the Ruby game for several months now :-(
I've answered that to a large degree in the other thread, but to stress out what bundler does: it limits the gems ChiliProject (or any rails app) "sees" in its environment to exactly the gems and their versions specified in the Gemfile and those of plugins as well as the needed dependencies. Bundler won't reinstall gems it finds already installed in correct versions on the system though (unless told so).
Nick Peelman wrote:
`bundle install` didn't actually need to install will_paginate, since i had already installed it, but I'm assuming its doing something to link it or whatever so that Chili knows where to look?
After running bundle install
there will be a Gemfile.lock that is created that shows the complete dependencies for your system, including plugin dependencies. Try running bundle install
without will_paginate listed as a dependency and then with it and you will see how Gemfile.lock changes.
Eric Davis