I am trying to create my own helper which will render specific content based on a view. A view with the name “large” for instance, I want my helper to render a large image using something like <%= smart_image "image" %> will render <img src="image_large.jpg" />
I need a way of passing the view’s name to the helper. Because of the complexity of this Rails project, I have over simplified my requirements above. I don’t want a solution like “pass the views name through a parameter” because that will not work in my project, I need it to be automatic.
Use action_name to get the name of the action (and the name of the view).