views:

244

answers:

2

I have this in my database

<input type="text" value="<%= account["accountname"] %>"/>

this will show the value of accountname in the field that I desire it too.

However, if I want the user to change that value to something else it doesn't allow that to occur.

If I put this in place of the above code sample

<%= text_field_tag :accountname, params[:accoutname] %>

This allows me to change the value and updates the database. However, the field stays blank in the views to the user.

I am wondering if there is a way for me to be able to change the database as well as display the accountname in the views

A: 

Did you cut-and-paste this code? If so, you have a typo.

params[:accoutname]

:accountname

jdl
hey thanks for pointing that out. I didn't copy and paste so luckily that wasn't the mistake. I figured out how to solve my problem.I needed to <input type="text" name= "accountname" value="<%= account["accountname"] %>"/>I basically need to add the name field so it works now.
Danish Khan
A: 
<input type="text" name= "accountname" value="<%= account["accountname"] %>"/>

I needed to add the name field to do what I wanted.

Danish Khan