Forum: Ruby on Rails form_tag

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
79dded1c9a4a68fb720f343ad4c97f6d?d=identicon&s=25 cloudedstrife (Guest)
on 2009-05-16 12:34
(Received via mailing list)
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'} %>
D63980ae502f0f3e827baf95c32166ee?d=identicon&s=25 Prabesh Shrestha (prabesh)
on 2009-05-16 19:44
(Received via mailing 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 %>
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2009-05-16 21:44
(Received via mailing list)
I would suggest using form_for rather than form_tag.  It makes life a
little
easier.

Colin


2009/5/16 prabesh shrestha <prabesh708@gmail.com>
This topic is locked and can not be replied to.