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

Render Collection with index #11

Open
roman-dubrovsky opened this issue Mar 22, 2017 · 7 comments
Open

Render Collection with index #11

roman-dubrovsky opened this issue Mar 22, 2017 · 7 comments
Labels
discuss The idea is clear, but some points need discussion feature Gem's API - new stuff that can be used by gem users

Comments

@roman-dubrovsky
Copy link
Contributor

= concept("welcome/top_participant/cell", collection: top5_users_game_sessions)

Also need to add the element index in the collection

@DDKatch
Copy link
Contributor

DDKatch commented Nov 2, 2018

@roman-dubrovsky now we can go with smth like this:
TableForSmthCell view part:

- collection.each_with_index do |element, index|
  = concept('welcome/top_participant/cell', element: {element, index})
- end

and we can archive the same functionality.

@DDKatch DDKatch added discuss The idea is clear, but some points need discussion question The idea/tension isn't clear and removed discuss The idea is clear, but some points need discussion labels Nov 2, 2018
@roman-dubrovsky
Copy link
Contributor Author

@DDKatch heh, I don't remember anything about this issue 😕

@AleksSenkou
Copy link
Contributor

Sounds reasonable thing to have for me.

We can go with:

= concept("welcome/top_participant/cell", collection: top5_users_game_sessions, index: true)

And mark index as false by default

Thoughts?

@AleksSenkou AleksSenkou added discuss The idea is clear, but some points need discussion feature Gem's API - new stuff that can be used by gem users and removed question The idea/tension isn't clear labels Nov 6, 2018
@DDKatch
Copy link
Contributor

DDKatch commented Nov 6, 2018

@AleksSenkou I thought that according to namespace 'welcome/top_participant/cell' it should represent single model for each element from collection. But even if it's for collection, what view we should use for a single one?

@AleksSenkou
Copy link
Contributor

@DDKatch yeah, it represents single model for each element from collection

@AleksSenkou
Copy link
Contributor

@DDKatch please, leave here a summary of yesterday's discussion

@DDKatch
Copy link
Contributor

DDKatch commented Nov 9, 2018

@AleksSenkou I got your point that it's more convenient to use separate logic for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss The idea is clear, but some points need discussion feature Gem's API - new stuff that can be used by gem users
Projects
None yet
Development

No branches or pull requests

3 participants