using a refactor code
add :pareant and :child in index route
transfer acction of pages controller to gem
flash and error messages in application layout