ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

issue with ____ #304

Closed ghost closed 6 years ago

ghost commented 6 years ago

I tried setting up my CRUD functionality. I expected something to happen. Nothing happened instead. When I click Remove/Add buttons it says localhost says "Cannot Post"

My repo link is https://github.com/rnunes00/project2-Eco-Snap and my question is about lines routes.js file.

superbuggy commented 6 years ago

what route does it say it cannot post to?

superbuggy commented 6 years ago

can you make sure your code is pushed? I'm not seeing any routes in your code.

superbuggy commented 6 years ago

Try these fixes...

In index.js

app.set('view engine', 'hbs')
app.engine('.hbs', hbs({
    extname: '.hbs',
    partialsDir: 'views/',
    layoutsDir: 'views/',
    defaultLayout: 'layout-main'
}))

In routesController.js...

router.get('/', (req,res) => {
    Snap.find({})
    .then((snaps) =>  {
-      res.render('/show-all', { snaps })
+      res.render('show-all', { snaps })
    })
})
aspittel commented 6 years ago

Hey Rindy -- couple more things: