This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based on my e-mail discussion with SNUGGS & reading Rails Guides, here are some helpful tips to keep in mind when using form helpers: | |
-First define the input elements you want/need as well as the functional purpose of including them. | |
-Then, pick the helper that best serves that goal. | |
Examples: | |
- When I want to accept a string for my object it's usually a textbox. | |
- When that information is pretty lengthy (e.g. paragraphs) I probably need a textarea. | |
- When I want to restrict a selection group to one I'd probably use a radiobutton | |
- When I want to have multiple selections within a selection group I probably want a checkbox | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 ways to extract elements from within XML namespaces using Nokogiri | |
When trying to select elemenets in the default namespace, e.g. "xmlns= http://www.w3.org/2005/Atom", try the following two ways. Note the xmlns=" attribute on entry element: | |
Original xml: | |
Nokogiri::XML(@xml_string).xpath("//author/name").each do |node| | |
puts node | |
end | |
1. Define a namespace context for your XPath expression and point your XPath steps to match elements in that namespace. Define a namespace-to-prefix mapping and use this prefix (a) in the XPath expression. |