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 end
def index end
def new
@user = User.new @users = User.find(:all) render :layout => false end
def edit end
def show end
def update end
def destroy end
def create
@user = User.new(params[:user])
if @user.save render :text =>'saved' else render 'home' end end
def login render :layout => false end
end
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.