Closed sahil162001 closed 11 months ago
So what's good about that? Please provide a real use-case.
So what's good about that? Please provide a real use-case.
By replacing the "map" with "collect" I think we can handle the collection of data, by using the collect . I also knew that map and collect are alias of each other but that is difference between map and collect.
Then please show me the difference by providing source code examples.
Then please show me the difference by providing source code examples.
i am getting this type of error and debugging and on searching getting this The error you are getting is an ActionView::Template::Error. This error is raised when an error occurs while rendering a template. In your case, the error is being caused by the map method on the student object. The student object is a string, and strings do not have a map method.
To fix this error, you will need to change the code that is trying to call the map method on the student object. One way to do this would be to change the code to use the collect method instead of the map method. The collect method works on collections, and strings are considered to be collection
I don't understand what you're saying. As you said,
map and collect are alias of each other
so they are no different. If you still insist with your opinion, you need to show me a Ruby source code which shows #map
and #collect
behaving differently. Understood?
but they have different way of working Sir, can we connect on LinkedIn
Sorry I'm not interested, thanks.
in enum.rb file at line number 14 we can replace the map with collect