Content_for availability in application_controller after_filter

98 Views Asked by At

As some context, I use this to build my breadcrumb. I print the breadcrumb to the page built from session state. In an after_filter I need to add to the session for the next page view.

In Rails 2 I was able to setup a view helper that used content_for, setting title and subtitle. In the after_filter in the application_controller I could use a helper to get at the content_for to add to the session

In Rails 3.2.x content_for accessed through the view_context helper in the after_filter is nil once. It's populated at nearly every other point however.

The challenge is finding a means to pass data from a view through to the controller where the session is available.

Does any one know how I can continue down this route or a decent way to pivot?

I still need to set the title and subtitle from the view and then be able to add them to the session.

0

There are 0 best solutions below