Hi all I just added a new field phone to form _form.html.erb created with: rails generate migration AddPhoneTotickets phone:string added with rake migraiton and the new field does not show in the browser new <div class="field"> <%= f.label :phone %><br /> <%= f.text_field :phone %> </div> old <p> <%= f.label :phone %><br /> <%= f.text_field :phone %> </p> -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 7, 2011, at 3:18 PM, Pepe Sanchez wrote:> Hi all > > I just added a new field phone to form _form.html.erb created with: > > rails generate migration AddPhoneTotickets phone:string > > added with rake migraiton > > and the new field does not show in the browser > > new > > <div class="field"> > <%= f.label :phone %><br /> > <%= f.text_field :phone %> > </div> > > > old > > <p> > <%= f.label :phone %><br /> > <%= f.text_field :phone %> > </p> >Did you add the form element in your view by hand? The migration alone will not create it. If you added the field to the view, ran the migration, and re-started the server, you should see the new field. Walter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Did you ever add any phone numbers to your database? -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 August 2011 20:18, Pepe Sanchez <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi all > > I just added a new field phone to form _form.html.erb created with: > > rails generate migration AddPhoneTotickets phone:string > > added with rake migraiton > > and the new field does not show in the browser > > new > > <div class="field"> > <%= f.label :phone %><br /> > <%= f.text_field :phone %> > </div> > > > old > > <p> > <%= f.label :phone %><br /> > <%= f.text_field :phone %> > </p>I don''t understand the code above, you say first that you have added a new field, phone, to the database but this does not appear on the form. Then you show ''new'' and ''old'' code where the only difference is that one uses div and the other p. Can you clarify exactly what the problem is and what is the code that is not working as you expect. One tip, though, is to check the html of the page (View > Page Source or similar in your browser) and check that this looks correct. If it looks ok but is still not showing what you expect then copy the complete html source and paste it into the w3c html validator and check that you have not got any html errors. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.