views:

79

answers:

1

Hello guys!

I have the same problem, as in this question. Did anybody find any solutions for this?

So I can't do like this:

flash[:notice] = "Successfully created #{@template.link_to('product', @product)}.

or like this:

@template.title("Page title is here.")

It worked perfectly in Rails 2.3. The main idea is to find out, how to use helper methods directly from conrollers, not from views.

Thanks.

A: 

You're doing it wrong.

First, you should setup the title of a page inside the view, not in your controller. You can simply place a call to the title helper within your view file.

About the link, flash shouldn't contain HTML. However, you can create the link manually.

flash[:notice] = %Q{Successfully created <a href="#{product_path(@product)}">product</a>.}
Simone Carletti
I know, that I can do it inside my view. But the question was, that I can't find variable similar to @template in Rails 2.
Igor Alexandrov