Uses model model_name.param_key as the object name #49

Merged
merged 1 commit into from Jul 24, 2012

Projects

None yet

2 participants

@fabiokr

For a namespaced model like Blog::Post, show_for outputs the model name as blogpost (so an attribute is output with a class blogpost_body). On Rails forms, it is output as blog_post (blog_post_body). To have that same behavior, this pull request changes show_for to get the object name from the model model_name.param_key.

Tests pass with this change, but I'm not sure if we should add a test about namespacing. Please let me know what you think :)

@rafaelfranca

Thank you for the pull request.

Yes, we will need a test about namespacing. Could you add? Do you need any help?

@fabiokr

@rafaelfranca Added test, please let me know if it needs additional improvements!

@rafaelfranca rafaelfranca merged commit edc8a5f into plataformatec:master Jul 24, 2012
@rafaelfranca

@fabiokr merged. Thank you so much.

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