.each on collection on index view created by scaffold

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

.each on collection on index view created by scaffold

Ben Hamment
Hi,

I'm new here :D.

I noticed that when you use scaffold it creates an index view and inside that index view it uses '.each' on the collection rather than using 
<%= render @cats %>
with a partial _cat.html.erb. I see this as a good opportunity for new users of the framework to learn the feature.

I have modified the scaffold generator to create the required partial and use the render syntax, should I create a PR or is it oversight on my part?

Related commit:
https://github.com/Otterpocket/rails/commit/5e78d07f1a1353f38950fd6d621ed503970c2016

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: .each on collection on index view created by scaffold

Alberto Almagro
Hi Ben,

good point. I would definitely add a PR for that.

Thanks!

El miércoles, 28 de marzo de 2018, 1:12:00 (UTC+2), Ben Hamment escribió:
Hi,

I'm new here :D.

I noticed that when you use scaffold it creates an index view and inside that index view it uses '.each' on the collection rather than using 
<%= render @cats %>
with a partial _cat.html.erb. I see this as a good opportunity for new users of the framework to learn the feature.

I have modified the scaffold generator to create the required partial and use the render syntax, should I create a PR or is it oversight on my part?

Related commit:
<a href="https://github.com/Otterpocket/rails/commit/5e78d07f1a1353f38950fd6d621ed503970c2016" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FOtterpocket%2Frails%2Fcommit%2F5e78d07f1a1353f38950fd6d621ed503970c2016\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhFMhmvAYUTeOfKgSpOe9j20E2JA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FOtterpocket%2Frails%2Fcommit%2F5e78d07f1a1353f38950fd6d621ed503970c2016\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhFMhmvAYUTeOfKgSpOe9j20E2JA&#39;;return true;">https://github.com/Otterpocket/rails/commit/5e78d07f1a1353f38950fd6d621ed503970c2016

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: .each on collection on index view created by scaffold

Ben Hamment
Thanks Alberto,

Do I create the PR against rails master ?

On Saturday, 31 March 2018 22:50:01 UTC+1, Alberto Almagro wrote:
Hi Ben,

good point. I would definitely add a PR for that.

Thanks!

El miércoles, 28 de marzo de 2018, 1:12:00 (UTC+2), Ben Hamment escribió:
Hi,

I'm new here :D.

I noticed that when you use scaffold it creates an index view and inside that index view it uses '.each' on the collection rather than using 
<%= render @cats %>
with a partial _cat.html.erb. I see this as a good opportunity for new users of the framework to learn the feature.

I have modified the scaffold generator to create the required partial and use the render syntax, should I create a PR or is it oversight on my part?

Related commit:
<a href="https://github.com/Otterpocket/rails/commit/5e78d07f1a1353f38950fd6d621ed503970c2016" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FOtterpocket%2Frails%2Fcommit%2F5e78d07f1a1353f38950fd6d621ed503970c2016\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhFMhmvAYUTeOfKgSpOe9j20E2JA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FOtterpocket%2Frails%2Fcommit%2F5e78d07f1a1353f38950fd6d621ed503970c2016\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhFMhmvAYUTeOfKgSpOe9j20E2JA&#39;;return true;">https://github.com/Otterpocket/rails/commit/5e78d07f1a1353f38950fd6d621ed503970c2016

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.