したがって、基本的に私のパーシャルには、次のコード行があります
...
<%= " active" if current_user."#{prop_row}" == "repeat-x" %>
...
そこで、次の変数「prop_id」、「prop_row」を次のように渡そうとしました。
<%= render :partial => "users/image_props/repeat", :prop_id => "mbr", :prop_row => "main_background_repeat" %>
エラーが発生します
/Users/codyjames408/rails/moz/app/views/users/image_props/_repeat.html.erb:4: syntax error, unexpected tSTRING_BEG
...= ( " active" if current_user."#{prop_row}" == "repeat-x" );...
...
^
行メソッドの代わりに文字列を追加するため、エラーが発生すると思います。しかし、私はこれを回避する方法を見つけようとして髪を引っ張っています。
これを大きなヘルパーメソッドか何かに変えたいです! 方法がわかりません...