Improvement for helper #207

Merged
merged 3 commits into from May 15, 2012

Conversation

Projects
None yet
5 participants
Contributor

plribeiro3000 commented Feb 19, 2012

I changed page_entries_info so it show only the last name of a model when it has a namespace. Hope u guys enhoy it.

m4tm4t commented Mar 8, 2012

+1.

Also, can you add an option to page_entries_info() for customize the displayed model ? I'm using namespaced models and the output is Displaying ga/games 1 - 30 of 24874 in total

page_entries_info(@games, "Games") should return Displaying Games 1 - 30 of 24874 in total

Contributor

plribeiro3000 commented Mar 8, 2012

If i got your question right, thats exactly what this commits are doing.
It splits the name when the class got namespace and print only the class name without the namespace.

m4tm4t commented Mar 8, 2012

Oh, I didn't watch the first commit and I just see that there is already an option called :entry_name
Sorry for the inconvenience !

Contributor

plribeiro3000 commented Mar 8, 2012

np at all. btw, with this commit, use page_entries_info on a namespaced model works a lot better.

rtlong commented Apr 7, 2012

@plribeiro3000 Thanks for these improvements. It would also be nice if entry_name defaulted to collection.first.class.model_name.human in the case of an ActiveModel-based collection (instead of an Array, I mean). That way, everything can be handled in the locale store instead of having to specify the entry name in the helper call.

Contributor

plribeiro3000 commented Apr 9, 2012

Hi @rtlong, can u give me an example of this kind of collection? I can use it for the test.

rtlong commented Apr 9, 2012

@plribeiro3000 ActiveModel is included into ActiveRecord, so your standard AR collections (Post.all) would qualify. The important point I was trying to make is that your collection would have to consist of entries composed from ActiveModel, as ActiveModel is where the I18n stuff is defined (...model_name.human).

Contributor

plribeiro3000 commented Apr 9, 2012

ok then, i will push the diff. =D

Contributor

plribeiro3000 commented Apr 9, 2012

It looks like the code is a lot cleaner right now. Tnx @rtlong

rtlong commented Apr 9, 2012

@plribeiro3000 Sweet thanks for doing that. This is a nice feature addition!

Contributor

plribeiro3000 commented Apr 9, 2012

Np at all. Let me know if u have another sugestions. Btw, is this project abandoned? The last commit on master is 2 months older. =/

rtlong commented Apr 9, 2012

You can always message @amatsuda directly... from the README:

Questions, Feedback

Feel free to message me on Github (amatsuda) or Twitter (@a_matsuda) ☇☇☇ :)

amatsuda merged commit e8bdf83 into kaminari:master May 15, 2012

Owner

amatsuda commented May 15, 2012

@plribeiro3000 Merged! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment