Assigns the JavaScript variable the given value.
Examples:
# Generates: my_string = "This is mine!"; page.assign 'my_string', 'This is mine!' # Generates: record_count = 33; page.assign 'record_count', 33 # Generates: tabulated_total = 47 page.assign 'tabulated_total', @total_from_cart
Source Code
# File action_view/helpers/prototype_helper.rb, line 880 def assign(variable, value) record "#{variable} = #{javascript_object_for(value)}" end
<code/>and<pre/>for code samples.