lundi 8 juin 2015

Show / Hide records based on multiple related model slections

I am building my first emberjs app using ember data and ember cli.

I have a set of videos, each of which belongs to a category. I would like the user to be able to build a playlist by selecting the categories they are interested in, and the videos belonging to that category to load in the {outlet}. I would also like to save this list of selected categories in the local store so they can get back to it later.

The categories have many videos, and the videos belong to a category.

I have the models and routes put together, so I can display a category with the related videos, it grabs the data from my rails app using the active model adapter, this is working great.

Where I am stuck (and learning ember has been a serious learning curve for me) is how to even approach this problem.

Could I create a series of category images that when clicked trigger an action that adds that category to an array, and then filter the search on the store to include the new categories so the videos just show up on the page dynamically?

Is there some other way I should be approaching this? Any and all advice is welcome. Link to tutorials, videos, articles, blog posts, etc.. that might give me an idea would also be great. I have spent many hours on google trying to get a direction to head with no results and some quick advice from someone who is over the learning curve would be a big help!

Aucun commentaire:

Enregistrer un commentaire