Nanyang Zhan wrote:
>>text_field("post", "title", "size" => 20)
will generate:
>><input type="text" id="post_title" name="post[title]" size="20" value="#{@post.title}" />so, when you name "post", there is a way to translate this word to
"@post", an object's name. how can I do that?
In your view you can do this with:
object_name = "post"
instance_variable_get("@#{object_name}")
However, most of the time you should use @post directly.
Dan Manges