Poll-based methods have been used to forecast elections in various countries and settings. A common factor of these models is the inclusion of a time-dependent variable to model the evolution of public support for a party or cause over time. Typically this variable is modeled as a random walk. This is problematic as the underlying assumptions of a random walk, which are very restrictive, don't hold empirically. We propose a more flexible alternative where the time-dependent variable is modeled using ideas from time series analysis. This approach is embedded in a generic model which allows for the inclusion of various covariates. We rely on Bayesian estimation techniques. Using Markov chain Monte Carlo algorithms, credible intervals can be obtained, and it is straightforward to include the uncertainty of the estimated parameters in forecasts. An application of the model to the German federal election of 2013 indicates the benefits of the new approach.