Accessing view methods in controller

A lot of time we need view methods in the controller for example: to show a link in flash message and we start writing HTML code in the controller using string concatenation, and it works perfectly fine. Here is the quick tip to make that code cleaner.

  view_context.link_to("Show", @product)

Similarly you can access a lot of other methods too. Pretty nice and clean ;)