trying with a view instead of javascript