title: Controller not updating database in Rails
body: <p>I am very new to rails, so bear with me. I am trying to update a cell in the database in the column "question_one", after selecting a radio button, but what I currently have is not updating my database efficiently. I am confused about what I am doing wrong. </p>
  
  <p>My controller to handle the input</p>
  
  <pre><code>def index
    @users = User.all
  end 
  
  def show
    @user = User.find(params[:id])
  end
  
  def new
    @user = User.new
  end
  
  def back
    @users = User.order("name").page(params[:page]).per(1)
  end
  
  # WHERE I AM UPDATING
  def update
    user = User.where(:id =&gt; params[:id]).first
  if user &amp;&amp; user.update_attributes(params[:user])
    flash[:success] = "Team Member successfully Updated!"
  else
    flash[:danger] = "Team Member unsuccessfully Updated!"
  end
  end
  
  def create
  @user = User.new(user_params) 
  if @user.save
    if @user.role == 0 
       @user.update_attribute :admin, true
    end
    #log_in @user
    flash[:success] = "Team Member successfully Created!"
    redirect_to users_url
  else
    render 'new'
  end
  end
  
  def edit
    @user = User.find(params[:id])
  end 
  
  def update
    @user = User.find(params[:id])
    if @user.update_attributes(user_params)
      flash[:success] = "Profile updated"
      redirect_to @user
    else
      render 'edit'
    end
  end
  
  def destroy
    User.find(params[:id]).destroy
    flash[:success] = "User deleted"
    redirect_to users_url
  end
  
  private
  
  def user_params
    params.require(:user).permit(:name, :email, :password,
                                 :password_confirmation, :role, :username,    :admin, :question_one)
   end
  
   # Confirms a logged-in user.
    def logged_in_user
      unless logged_in?
      store_location
      flash[:danger] = "Please log in."
      redirect_to login_url
    end
   end
  
   # Confirms the correct user.
  def correct_user
    @user = User.find(params[:id])
    redirect_to(root_url) unless @user == current_user
  end
  
  # Confirms an admin user.
  def admin_user
    redirect_to(current_user) unless current_user.admin?
  end
  end
  </code></pre>
  
  <p>My back.html.erb</p>
  
  <pre><code>&lt;% @users.each do |user| %&gt;
  &lt;% result = 0%&gt;
  &lt;h4&gt; &lt;%= user.name  %&gt; &lt;/h4&gt;
  &lt;%= form_for(user) do |f| %&gt;
     &lt;%= f.label :Question_one %&gt;
     &lt;%= f.radio_button :question_one, 1 %&gt;
     &lt;%= f.radio_button :question_one, 2 %&gt;
     &lt;%= f.radio_button :question_one, 3 %&gt;
     &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  &lt;% end %&gt;
  &lt;%= paginate @users %&gt;
  </code></pre>
  
  <p>I have been staring at this for hours now, so I will really appreciate the help. Thanks in advance!</p>