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

Work along with FriendlyID5 out of the box #128

Closed
johannesluedke opened this issue Aug 22, 2015 · 4 comments
Closed

Work along with FriendlyID5 out of the box #128

johannesluedke opened this issue Aug 22, 2015 · 4 comments

Comments

@johannesluedke
Copy link

When using FriendlyID5 (without deprecated finders and their monkey-patching), for a slug stored in params[:id], at the moment it's necessary to use

expose(:object) { params[:id] ? Model.friendly.find(params[:id]) : Model.new(model_params) }

which takes away a lot of the niceness of decent_exposure.
It would be nice if the .friendly.find style could be configured out of the box along the lines of

 expose(:object, config: :friendly) 

or similar

@mattpolito
Copy link
Member

Thanks @johannesluedke for your input. That seems like a pretty specific request but we will definitely consider this use case when defining our feature requests for v3.0.

@johannesluedke
Copy link
Author

To make it less specific - it would be nice to be able to set .friendly.find as the finder option like so

  expose(:article, finder: < .friendly.find > )

Currently a symbol is passed to the finder option and I am not sure how a chained method called can be mapped to a symbol properly - but this would solve as well and be less specific

@mattpolito
Copy link
Member

we will definitely have that

@johannesluedke
Copy link
Author

Cool :)
Thanks for your contributions (y)

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

No branches or pull requests

2 participants