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

Improvement for helper #207

Merged
merged 3 commits into from May 15, 2012
Merged

Improvement for helper #207

merged 3 commits into from May 15, 2012

Conversation

plribeiro3000
Copy link
Contributor

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
Copy link

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

@plribeiro3000
Copy link
Contributor Author

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
Copy link

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 !

@plribeiro3000
Copy link
Contributor Author

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

@lukashoffmann
Copy link

+1

@rtlong
Copy link

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.

@plribeiro3000
Copy link
Contributor Author

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

@rtlong
Copy link

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).

@plribeiro3000
Copy link
Contributor Author

ok then, i will push the diff. =D

@plribeiro3000
Copy link
Contributor Author

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

@rtlong
Copy link

rtlong commented Apr 9, 2012

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

@plribeiro3000
Copy link
Contributor Author

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
Copy link

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 amatsuda merged commit e8bdf83 into kaminari:master May 15, 2012
@amatsuda
Copy link
Member

@plribeiro3000 Merged! Thank you very much!

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.

None yet

5 participants