#summary Summary of Ejs's view helpers. = Introduction = EJS provides view helpers for common tasks. These helpers are very similar to those found in the Ruby On Rails framework. || date_tag || form_tag || form_tag_end || hidden_field_tag || input_field_tag || || is_current_page || link_to || submit_link_to || link_to_if || link_to_unless || || link_to_unless_current || password_field_tag || select_tag || single_tag_for || start_tag_for || || submit_tag || tag || tag_end || text_area_tag || text_tag || || text_field_tag || url_for || img_tag || = Details = === date_tag(name, value, html_options) === Creates a date tag {{{ date_tag('Installation[date]', new Date(1982, 10,20) ) }}} === form_tag(action, html_options) === Creates a start form tag. {{{ form_tag('/myaction',{multipart: true}) }}} === end_form_tag() === Creates a start form tag. {{{ form_tag_end() }}} === hidden_field_tag( name, value, html_options) === Creates a hidden field. {{{ hidden_field_tag('something[interesting]', 5) => "" }}} === img_tag === Creates an image tag. {{{ img_tag('/some.png', 'something') => "something" }}} === input_field_tag === Creates an input field tag. {{{ input_field_tag('something[interesting]', 5) => "" }}} === is_current_page === Returns true if the url equals location.href or location.pathname, false if otherwise. {{{ is_current_page('yahoo.com') => false }}} === link_to === Creates a link to another page. {{{ link_to('hello world', '/something/here') => "hello world" }}} === submit_link_to === Creates a submit button that links to another page. {{{ submit_link_to('holla', '/new/location') => "" }}} === link_to_if(condition, name, url, html_options, post, block) === Just like link_to if the condition is true. If condition is false it returns name. === link_to_unless(condition, name, url, html_options, block) === Just like link_to if the condition is false. If condition is true it returns name. === link_to_unless_current(name, url, html_options, block) === Just like link_to if the url passed in matches the current pages url. Returns name if otherwise. === password_field_tag === Returns a password field. {{{ password_field_tag('something[interesting]', 5) => "" }}} === select_tag === Returns a select tag. {{{ var choices = [ {value: 1, text: 'First Choice' }, {value: 2, text: 'Second Choice'}, {value: 3, text: 'Third Choice'} ] select_tag('mySelectElement', 2, choices) => "" }}} === single_tag_for === Helper for creating a single tag like
=== start_tag_for === Helper for creating a beginning tag like
=== submit_tag === Creates a submit tag. {{{ submit_tag('Submit') => "" }}} === tag === Creates a general tag. === tag_end === Creates an end tag like
=== text_area_tag === {{{ text_area_tag('task[description]', 'Here is some text.\nA new line.') => "" }}} === text_field_tag === {{{ text_field_tag('something[interesting]', 5) => "" }}} === url_for === returns a string that changes the url.