public Method

GeneratorMethods.assign(variable, value)

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.