Rails text_field with no method associated -
i'm having problem create text_field without method association. maybe don't need :-)
i have 2 radio_buttons associated same method:
<%= radio_button :comment, :author, "anonymous" %> anonymous <br> <%= radio_button :comment, :author, "real_name" %> name <br>
what have text_field when user click on radio_button "real_name" can verify value in new text_field.
basically controller like:
@comment = comment.new(params[:comment])
if @comment.author == "real_name" @comment.author = "value-from-the-new-textfield end
there way it?
regards,
victor
if want generate text_field without associated object/method, use text_field_tag
Comments
Post a Comment