I want to render action if my model is not valid.
render "book_page"
https://gist.github.com/f7259eb79d1f2c951036
But for now @prices_per_night and @number_of_nights are nil when i click submit button. How to prevent this?
I tried to move this form to partial but it now happend, because I cant render only partial. Or Am I wrong?
Using
renderdoes not make Rails call the relevant method,book_page, in the controller. It proceeds directly tobook_page.html.erband, at this point, no method has set your instance variables so they appearnil.