Dear message-board users
I am still learning Ruby on Rails so the answer to the question I am
posting might be obvious, but I can't see any logical reason why I am
getting this strange behaviour, so here goes:
To test what I had learned in the Ajax chapter of Agile Web development
with Rails I created a simple app which presents the user with a page
that has three remote links back to the server. Only one of the links
has a method in the controller. The other two just invoke one view
each. Since I didn't want the layout to be rendered for any of the
three as they were generating output for an ajax-request, and to honour
the DRY principle at the same time, I created a before_filter executing
a method which set rendering of the layout to false when the three
methods were called. But for some reason instance variables aren't
passed to the view when I set the layout to false in the before filter.
To get the variables passed along to the view I have to set the
rendering of the layout to false in the method itself. Why is that?
Does that make any sense?
I'll include the source code to make it easier to understand what works
and what doesn't: