I have been developing rails apps for awhile and I have done some refactoring of my old apps to comply with REST et al.
Why on earth did the team get rid of instance variables when
render. Here’s what I mean (taken from the 3rd edition)
module StoreHelper def page_title @page_title || "Pragmatic Store" end end #Now the view code simply calls the helper method. <h3><%= page_title %></h3>
If I understand this correctly,
@page_title is set by the controller.
But what happens if
render :action is called for form validation? We want to use render so that we can take advantage of all of the rails validation error messages and form goodness.
With Rails 2, the controller instance variables are no longer set. I have a few solutions, but none of them are clean and involve hashes and I am DEFINITELY repeating myself.
Thanks in advance and you might want to add this in more than passing to the new book…