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

gravitystorm
Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants