ruby on rails - Custom Controller variable in application.html -
user story:
- action facebook has open graph object.
- for need modify tag defined in application.html
problem:
- the logic need defined in helpers or application_controller
- from understanding not clean.
question:
- i want pass variables directly application.html view.
- preferably pass variables custom controller application.html. way can still utilize rails routing system pass variables when on facebook action.
the common mechanism passing variables in view create instance variables in controller these ported on automatically.
this standard approach if used. things may not used, create helper method take care of providing them.
this difference between doing this:
def show @facebook_graph = ... end
and in helper:
def facebook_graph ... end
Comments
Post a Comment