In: |
lib/Borges/HTML/HtmlRenderer.rb
|
Parent: | Object |
Renderer for HTML with callbacks
action_url | [RW] | |
callbacks | [RW] | |
rendering_context | [RW] |
Creates a <select> menu of two choices with labels (default to Yes and No). If bool is true, the first item is the default.
Creates a link to download object with the text of text. mime_type will default to text/plain.
to_s will be sent to object, and the resulting string will be returned to the user.
WARNING! A download link created by this method will remain live until Borges is shut down. The space used will not be reclaimed. If you are creating many download links, you may wish to serve them from outside Borges.
Creates a link with image from img_url as content. The link executes block when executed. Image has alt text of alt.
Creates an option for a <select>. label sets the label for the select. The option will be selected if selected is true.
Creates a password input containing value. It is however not a good idea to output the current password to html, since the user can retrieve it by looking at the source.
Creates a password input that gets its value by calling sym to obj, then calls sym= to obj when submitted.
Creates a radio button that is part of radio group group. The radio button will be checked if checked is true.
group must come from a previous radio_group:
group = r.radio_group r.radio_button(group) do ... end
Creates a <select> from list.
Calls each on list and if list yields a single item, then to_s will be called on the item for use as the label. If list yields two items, then the second item will be used as a label.
If selected matches an item in list, that item will be selected.
callback will be passed the user-selected item.