Hi Guys,
I am very new to Ruby and Rails, am trying to understand the syntax of
it. I got this code from a book but can’t understand what does "</
option>“end.to_s” do. Here is the complete “view” code. Note: This
code works fine
A Simple Form
<%= start_form_tag(:action => "show_formdata") %>Text Field: <%= text_field_tag("name", "Aneesha") %>
Drop-down Selection Box: <% languages = ["Ruby", "Java", "C#"].map do |lang| "#{lang}"end.to_s %>
<%= select_tag(“prog_languages[]”, languages, :multiple => “true”)
%>
Checkboxes: <%= check_box_tag("operating_systems[]", "Windows") %>Windows <%= check_box_tag("operating_systems[]", "Linux") %>Linux <%= check_box_tag("operating_systems[]", "Mac") %>Mac
<%= submit_tag("Submit Form") %> <%= end_form_tag %>