values are being stored as null in mysql d/b

hi!! i am building a form in ROR but all the values are being stored as
null in mysql d/b.

my controller code:

class UsersController < ApplicationController

  def home
  render :layout => false

  def index

  def new

  @user =
  @users = User.find(:all)
render :layout => false

  def edit

  def show

  def update

  def destroy

  def create

@user =[:user])

  render :text =>'saved'
  render 'home'

def login
  render :layout => false


my view code.

<%= form_for @user do |f| %>

user_name: <%= f.text_field :user_name %></br>
user_fname: <%= f.text_field :user_fname %></br>
user_name: <%= f.text_field :user_lname %></br>
<%= f.submit %></br>

<% end %>

<% @users.each do |u| %>
  <%= u %>
<% end %>

could someone please help me with this issue. the values are stored in
d/b but as null.

Thanks in Advance. :slight_smile:

How are you getting on with working through (or similar)?


Colin Law wrote in post #1108486:

Do you mean that you are not a beginner and therefore do not need to
work through the tutorial? If you are not a beginner I would have
thought that you would know to look in development.log to find whether
it is the form or the controller/model that is causing the problem and
to see the query being run, and also would have read the Rails Guide
on Debugging and would know about pry and other tools that can help
you find the problem.


Can you verify the schema of your users table? The form written here implies that it has columns named “user_name”, “user_fname”, and “user_lname”. Is this correct?

–Matt Jones