{"action":"opened","issue":{"url":"https://api.github.com/repos/ericf/express-handlebars/issues/145","labels_url":"https://api.github.com/repos/ericf/express-handlebars/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/ericf/express-handlebars/issues/145/comments","events_url":"https://api.github.com/repos/ericf/express-handlebars/issues/145/events","html_url":"https://github.com/ericf/express-handlebars/issues/145","id":107780485,"number":145,"title":"How to render only a partial","user":{"login":"brendanw","id":585321,"avatar_url":"https://avatars.githubusercontent.com/u/585321?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanw","html_url":"https://github.com/brendanw","followers_url":"https://api.github.com/users/brendanw/followers","following_url":"https://api.github.com/users/brendanw/following{/other_user}","gists_url":"https://api.github.com/users/brendanw/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanw/subscriptions","organizations_url":"https://api.github.com/users/brendanw/orgs","repos_url":"https://api.github.com/users/brendanw/repos","events_url":"https://api.github.com/users/brendanw/events{/privacy}","received_events_url":"https://api.github.com/users/brendanw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-22T19:07:08Z","updated_at":"2015-09-22T19:07:08Z","closed_at":null,"body":"I have a dropdown that may be reused within several pages. I have put the code for that dropdown inside of a partial because I want to be able to update the options in the dropdown without re-rendering the whole page.\r\n\r\npartials/region-dropdown.handlebars:\r\n    <select class=\"region\" name=\"region\" id=\"region\">\r\n      {{#each regionList}}\r\n        <option value=\"{{@index}}\">{{this}}</option>\r\n      {{/each}}\r\n    </select>\r\n\r\nWhen I first load the view and layout that holds this partial, the regionList is populated correctly. This is the code I use for initially rendering the page:\r\n\r\n      res.render('exit-selector', {\r\n        countryList : countries,\r\n        regionList : regions,\r\n        NavItems : [\r\n          { name : \"Home\", path : \"/\" },\r\n          { name : \"About\", path : \"/about\" },\r\n          { name : \"Team\", path : \"/team\" },\r\n          { name: \"Browse Exits\", path : \"/exits\" }\r\n        ]\r\n      });\r\n\r\nI have a jquery ajax call that occurs whenever the country dropdown on that page changes, it is supposed to update the options within the dropdown within region-dropdown.handlebars only. I try to re-render this partial with the following code:\r\n\r\n/** Load Partial */\r\napp.get('/region-dropdown', function(req, res) {\r\n  res.render('partials/region-dropdown',\r\n      {\r\n        layout : false,\r\n        data : {\r\n          regionList : [\"Austria\", \"Switzerland\"]\r\n        }\r\n      }\r\n  );\r\n});\r\n\r\nHowever, what is rendered is just the partial without any options. It does not look like the regionList data is successfully passed to the partial.\r\n\r\nI am pretty new to web development and have been struggling for many hours trying to make this work. Please let me know if I am going about this the right way or if there is a small tweak that will make this work."}}