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
merged 2 commits into from Jun 26, 2019

Conversation

Projects
None yet
2 participants
@gravitystorm
Copy link
Collaborator

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

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 88.234%
Details

@gravitystorm gravitystorm deleted the gravitystorm:simplify_partials branch Jul 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.