相关疑难解决方法(0)

为什么空格会影响ruby函数调用?

我在这段代码中遇到语法错误

render json: {
    "what" => "created", 
    "whatCreated" => "thing",
    "htmlOutput" => render_to_string (partial: "some_partial")
}
Run Code Online (Sandbox Code Playgroud)

但是使用这段代码我不会:

render json: {
    "what" => "created", 
    "whatCreated" => "thing",
    "htmlOutput" => render_to_string(partial: "some_partial")
}
Run Code Online (Sandbox Code Playgroud)

怎么来render_to_string打破我的rails应用程序后的那个空间?

ruby syntax whitespace

5
推荐指数
2
解决办法
939
查看次数

标签 统计

ruby ×1

syntax ×1

whitespace ×1