On Tue, Jul 14, 2009 at 1:50 AM, Shahin Kordasti < [email protected]> wrote:
> > Hi, > > I recently started working with rails and maybe Im a bit spoiled coming > from a Java background but is there a proper api document for the > objects that are used in erb.html pages? > > For example, I read a tutorial mentioning a form variable that just seem > to magically exist (no idea who/where it is actually instantiated, e.g. > <%= form.label :name, "Name:" %>) but what methods are available in this > form object? > > And what other objects, and methods, are magically available on erb.html > pages? > > I checked out http://api.rubyonrails.org and it does list a whole bunch > of classes and methods but I have no idea what type this "form" variable > is referencing. Shahin. learning anything takes time. For example. the form in <%= form.label :name, "Name:" %> is called block parameter as in the following: <% form_for :person, :url => { :action => "update" } do |form| %> <%= f.error_messages %> First name: <%= form.text_field :first_name %><br /> Last name : <%= form.text_field :last_name %><br /> Biography : <%= form.text_area :biography %><br /> Admin? : <%= form.check_box :admin %><br /> <% end %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

