FORM HELPERS    RAILS 3
FORMS<%= form_for(@person) do |f| %>   <%= f.label :first_name %> <br />   <%= f.text_field :first_name %>   <%= f.label :...
form_for(@person)• allows same syntax for new and edit form   • Person.new => /people   • Person.find(4) => /people/4• in r...
FORM ELEMENTS•   label•   text_field•   password_field•   text_area•   check_box•   radio_button•   file_field•   select•
TAG HELPERS•   When forms are not associated with a model•   use form_tag and related helpers    •   label_tag    •   text...
FUTHER READINGhttp://guides.rubyonrails.org/form_helpers.html
Upcoming SlideShare
Loading in …5
×

Form helpers

964 views

Published on

Overview of Form Helpers (Rails 3)

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
964
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Form helpers

    1. 1. FORM HELPERS RAILS 3
    2. 2. FORMS<%= form_for(@person) do |f| %> <%= f.label :first_name %> <br /> <%= f.text_field :first_name %> <%= f.label :last_name %><br /> <%= f.text_field :last_name %> <%= f.submit %><% end %>
    3. 3. form_for(@person)• allows same syntax for new and edit form • Person.new => /people • Person.find(4) => /people/4• in rails console, can experiment using "app" • app.url_for(Person.new) • app.url_for(Person.first)
    4. 4. FORM ELEMENTS• label• text_field• password_field• text_area• check_box• radio_button• file_field• select•
    5. 5. TAG HELPERS• When forms are not associated with a model• use form_tag and related helpers • label_tag • text_field_tag • submit_tag • etc.
    6. 6. FUTHER READINGhttp://guides.rubyonrails.org/form_helpers.html

    ×