Rails text_field with no method associated

ruby-on-rails

Solution

If you want to generate a text_field without an associated object/method, use `text_field_tag`

Problem

i'm having a problem to create a text_field without a method association. Maybe i even don't need it :-) I have two radio_buttons associated to the same method: ``` <%= radio_button :comment, :author, "anonymous" %> Anonymous <br> <%= radio_button :comment, :author, "real_name" %> Name <br> ``` What i would like to do is to have an text_field which when the user click on the radio_button "real_name" i can verify the value in this new text_field. Basically my Controller would be something like: @comment = Comment.new(params[:comment]) if @comment.author == "real_name" @comment.author = "value-from-the-new-textfield end There is any way to do it? Regards, Victor

Original source