Hi all, I am very new to ruby...could someone help me with the method form_ tag? I think I got my syntax wrong... <h1>Post new classified</h1> <% form_tag( :action => ''create ) do %> <p><label for="classified_title">Title</label><br/> <%= text_field ''classified'', ''title'' %></p> <p><label for="classified_price">Price</label><br/> <%= text_field ''classified'', ''price'' %></p> <p><label for="classified_location">Location</label><br/> <%= text_field ''classified'', ''location'' %></p> <p><label for="classified_description">Description</label><br/><%= text_area ''classified'', ''description'' %></p> <p><label for="classified_email">Email</label><br/> <%= text_field ''classified'', ''email'' %></p> <%= submit_tag "Create" %> <% end %> <%= link_to ''Back'', {:action => ''list''} %>
I am also new to ruby .Looking at the code I think you have missed '' after create><% form_tag( :action => ''create ) do %><% form_tag( :action => ''create'' ) do %> On May 16, 12:50 am, cloudedstrife <jhsu1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I am very new to ruby...could someone help me with the method form_ > tag? I think I got my syntax wrong... > > <h1>Post new classified</h1> > > <% form_tag( :action => ''create ) do %> > > <p><label for="classified_title">Title</label><br/> > <%= text_field ''classified'', ''title'' %></p> > <p><label for="classified_price">Price</label><br/> > <%= text_field ''classified'', ''price'' %></p> > <p><label for="classified_location">Location</label><br/> > <%= text_field ''classified'', ''location'' %></p> > <p><label for="classified_description">Description</label><br/ > > <%= text_area ''classified'', ''description'' %></p> > <p><label for="classified_email">Email</label><br/> > <%= text_field ''classified'', ''email'' %></p> > > <%= submit_tag "Create" %> > <% end %> > > <%= link_to ''Back'', {:action => ''list''} %>
I would suggest using form_for rather than form_tag. It makes life a little easier. Colin 2009/5/16 prabesh shrestha <prabesh708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > I am also new to ruby .Looking at the code I think you have missed '' > after create > ><% form_tag( :action => ''create ) do %> > <% form_tag( :action => ''create'' ) do %> > > On May 16, 12:50 am, cloudedstrife <jhsu1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi all, > > > > I am very new to ruby...could someone help me with the method form_ > > tag? I think I got my syntax wrong... > > > > <h1>Post new classified</h1> > > > > <% form_tag( :action => ''create ) do %> > > > > <p><label for="classified_title">Title</label><br/> > > <%= text_field ''classified'', ''title'' %></p> > > <p><label for="classified_price">Price</label><br/> > > <%= text_field ''classified'', ''price'' %></p> > > <p><label for="classified_location">Location</label><br/> > > <%= text_field ''classified'', ''location'' %></p> > > <p><label for="classified_description">Description</label><br/ > > > > <%= text_area ''classified'', ''description'' %></p> > > <p><label for="classified_email">Email</label><br/> > > <%= text_field ''classified'', ''email'' %></p> > > > > <%= submit_tag "Create" %> > > <% end %> > > > > <%= link_to ''Back'', {:action => ''list''} %> > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---