Skip to content
  • Peter Schilling's avatar
    f9960f2d
    Change render to support any hash keys in locals · f9960f2d
    Peter Schilling authored
    this lets you pass ruby keywords to templates:
    
        <%= render 'example', class: "cool" %>
    
        <%= render 'example', "spaces are" => "a-ok" %>
    
        <%= render 'example', Foo: "bar" %>
    
    Previously you'd see confusing syntax errors like this:
    
        SyntaxError (.../_example.html.erb:1: syntax error, unexpected '='
    
    Now you can reference invalid identifiers through local_assigns.
    
    If you try to use an invalid keyword (e.g. class) in your template, you
    get a syntax error on the line where you use it.
    f9960f2d
    Change render to support any hash keys in locals
    Peter Schilling authored
    this lets you pass ruby keywords to templates:
    
        <%= render 'example', class: "cool" %>
    
        <%= render 'example', "spaces are" => "a-ok" %>
    
        <%= render 'example', Foo: "bar" %>
    
    Previously you'd see confusing syntax errors like this:
    
        SyntaxError (.../_example.html.erb:1: syntax error, unexpected '='
    
    Now you can reference invalid identifiers through local_assigns.
    
    If you try to use an invalid keyword (e.g. class) in your template, you
    get a syntax error on the line where you use it.
Loading