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

Simplify partial rendering when the partial is named after the model #2278

merged 2 commits into from Jun 26, 2019


Copy link

@gravitystorm gravitystorm commented Jun 26, 2019

During review of #2207 I realised that we can simplify a bunch of our partial calls. For example, if @trace is a Trace model, then instead of:

<%= render :partial => "trace", :object => @trace %>

... you can instead call...

<%= render @trace %>

... and Rails will find the partial named after the model, and pass the object into the partial automatically. It also works with collections.

@tomhughes tomhughes merged commit 0211141 into openstreetmap:master Jun 26, 2019
2 checks passed
@gravitystorm gravitystorm deleted the simplify_partials branch Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants