Inject resource and views working together. TODO review all this example