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

Rails own 'form_for' / 'form_with' helper #50

Open
skorth opened this issue Feb 24, 2018 · 2 comments
Open

Rails own 'form_for' / 'form_with' helper #50

skorth opened this issue Feb 24, 2018 · 2 comments
Assignees

Comments

@skorth
Copy link

skorth commented Feb 24, 2018

Hey there,

nice to see hashid turning into its own rails gem. But what about form_for and form_with helpers in Rails? If i want to obscure ID's within URL's it works fine. Using form_for would generate its CLASS and ID automatically by using to_key and reveal the original ID within the DOM. What do you think, is that something that should be addressed?

@jcypret
Copy link
Owner

jcypret commented Oct 21, 2018

Hi @skorth. Thanks for bringing this up! I was able to recreate using the view helper dom_id(@model, :action). Hadn't considered that scenario before.

Looks like overriding to_key instead of to_param would sort things out, but need to review typical usage. It makes sense conceptually that the model's key would be the hashid, not the database id.

@jcypret jcypret removed the wip label May 25, 2019
@jcypret jcypret self-assigned this May 25, 2019
@mikehatfield
Copy link

@jcypret Any updated thoughts on this topic?

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

No branches or pull requests

3 participants