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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -