method
assign
v3.0.0 -
Show latest stable
- Class:
ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods
assign(variable, value)public
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