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. :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 10 May 2013 05:40, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hi!! i am building a form in ROR but all the values are being stored as > null in mysql d/b.How are you getting on with working through railstutorial.org (or similar)? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1108486:> On 10 May 2013 05:40, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> hi!! i am building a form in ROR but all the values are being stored as >> null in mysql d/b. > > How are you getting on with working through railstutorial.org (or > similar)? > > ColinIts a great website for any ROR beginners... Thanks :) would you please resolve the issue which i am having.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 10 May 2013 07:53, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1108486: >> On 10 May 2013 05:40, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> hi!! i am building a form in ROR but all the values are being stored as >>> null in mysql d/b. >> >> How are you getting on with working through railstutorial.org (or >> similar)? >> >> Colin > > Its a great website for any ROR beginners... Thanks :) > > would you please resolve the issue which i am having..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. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Friday, 10 May 2013 00:40:36 UTC-4, Ruby-Forum.com User wrote:> > hi!! i am building a form in ROR but all the values are being stored as > null in mysql d/b. > > 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 %> > >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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/SikThYQJkq0J. For more options, visit https://groups.google.com/groups/opt_out.