User Story:
- Action for Facebook that has open graph object.
- For this I need to modify the tag defined in application.html
Problem:
- The logic would need to be defined in helpers or the application_controller
- From my understanding this is not clean.
Question:
- I want to pass variables directly into the application.html view.
- Preferably pass those variables from a custom controller into the application.html. This way I can still utilize the rails routing system to only pass those variables when I am on the facebook action.
The common mechanism for passing variables in to the view is to create instance variables in your controller as these are ported over automatically.
This is the standard approach if it is almost certain they will be used. For things that may not be used, create a helper method that will take care of providing them.
This is the difference between doing this:
And this in a helper: