Creates a file field that sets up the correct naming structure for JMVC file types.
- The name of the form element.
- Optional default value.
- Optional html attributes.
form_tag
form_tag(url_for_options, html_options) -> String
Creates a file field that sets up the correct naming structure for JMVC file types.
- Object used to direct to an action.
- Options used to create html attributes.
form_tag_end
form_tag_end() -> String
Outputs "</form>".
get_data
get_data(el) -> Object
Retrieves the data stored in the private hash for the passed element el. The key for the data is assumed
to be located in the attribute _data, where it was placed by a call to link_data. Returns the data for the passed
key, if found, or null. For example:
var recipe = MVC.View.Helpers.get_data(params.element);
- Element containing a _data attribute, which contains a key for data retrieval.
hidden_field_tag
form_tag_end(name, value, html_options) -> String
Creates a hidden field.
- The name of the form element.
- Optional default value.
- Optional html attributes.
img_tag
img_tag(image_location, options) -> String
Creates an image tage that loads from the resources/images folder.
Stores data passed in store in a private hash structure. Returns an attribute to place in an HTML element,
which contains the key to retrieve the data. The attribute is something of the form _data='0', where
0 can be any integer. For example:
<tr class='recipe' <%=link_data(recipe)%>>
- Data somehow representing the element being created, which is to be stored for later retrieval.
- Optional html attributes. It can take a special
size attribute that takes a string like '30x5'. For example:
text_area_tag('todos[description]',"Take out trash",{size: '30x5'})