Hi! Rails newbie here - so far, loving it.

Going through the Learnings Rails book and the for the most part, I am  
learning quite a bit (in spite of the errata). I did see something odd.

On 8.2.2, when I invoke the following private method:

def text_field(method, options={})
        label_for(method, options) + super(method, options)
end
private
        def label_for(method, options={})
        label(:label || method) + "<br />"
end

I should be able to print the label and the field:
<%= f.text_field :name %>

However, it came across on the view screen form, it came across. as:

Label
[FIELD BOX]

To actually display the label, I used this instead:

label(options.delete(:label) || method) + "<br />"
Which is fine, but I am little confused - is ' label(:label || method)  
+ "<br />" ' supposed to work as intended or was the behavior changed  
in the 2.3.x series (which I am using right now)?

  - Rilindo

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to