Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal config for make works with kaminari #1

Closed
wants to merge 3 commits into from

Conversation

ceritium
Copy link

This is a early pull request, I want know what do you think about this.

The idea is make the gem configurable, you can define the name of the methods, this allow make compatible with other gems.

TODO:

  • Add some tests.
  • Include generators for kaminari and will_paginate.
  • Add more methods configurables
  • Allow send per_page and page as params to the helper or use the config.

@ceritium ceritium force-pushed the configurable branch 2 times, most recently from b8f5a9f to a944ae9 Compare August 19, 2015 21:31
@ceritium ceritium changed the title [wip] Minimal config for make works with kaminari Minimal config for make works with kaminari Aug 20, 2015
Can override general configuration in `pages!`, ex:

json.pages! @books, url: api_books_url(format: :json), per_page_param: :page_size
@ceritium ceritium force-pushed the configurable branch 2 times, most recently from 2bed3cf to 845d370 Compare August 20, 2015 16:05
@bacarini
Copy link
Owner

Hi @ceritium, sorry for the late answer and thanks for all work you have done so far.

Well, I like the idea to let stuff configurable but I believe this it not necessary when we are using kaminari and will_paginate. I figure out a way to do that. You can look at #2.

Also, pagination links is not as json-api says it should be. So, this PR is to fix that. I will be very thankful if you can review it and let your thoughts as well. 😃

I come up with this idea based on another PR on ActiveModel::Serializer.

@bacarini
Copy link
Owner

I am closing this PR since the new version works well with kaminari and will_paginate. But tks so much for the work you put here man. I really appreciate it. 👍

@bacarini bacarini closed this Aug 21, 2015
@ceritium
Copy link
Author

Ok, no problem. If the problem is solved I am happy.

Also I see that json-api recommend this format "page[number]=3&page[size]=1".
Anyway, do you think that could be interesting allow customize it?

@bacarini
Copy link
Owner

How would you customize it?

Just remember, that the gem follows the json-api spec and its examples

@ceritium
Copy link
Author

Allow to change the parameters for pagination. This does not follow the json-api spec but could be useful for legacy code.

PS: I do not need this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants