public Method

GeneratorMethods.literal(code)

Returns an object whose #to_json evaluates to code. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method.

Source Code

# File action_view/helpers/prototype_helper.rb, line 671
def literal(code)
  ActiveSupport::JSON::Variable.new(code.to_s)
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.