On 24 April 2011 10:28, amrit pal pathak <[email protected]> wrote: > I generated controller and view as. > "script/generate controller home index" > > > Tried to make a form .Edited the index method in home controller and > added follwoing stuff inside
You added the code below to the index method of the home controller (so in controllers/home_controller.rb)? If so then it is not surprising it did not work. Where did you put it? > > <%= form_for @home do |f| %> > <%= f.label :first_name %>: > <%= f.text_field :first_name %><br /> > > <%= f.label :last_name %>: > <%= f.text_field :last_name %><br /> > > <%= f.submit %> > <% end %> > > Then started the server But it didnt generate form.Am i missing > anything(i hope so).Should anything be added in index.html.erb file in > home view?Or else?Using rails 3.0.7.I Have read the form generation > tutorils but could not understand lot.So asking here. What do you see if you look at the html generated by the above (assuming you have actually put it in one of the views)? In the browser do View > Page Source or similar (dependant on browser). 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

