I want to convert this embedded ruby html
<div ng-controller="PollCtrl" ng-init="polls = <%= @plan.polls.to_json %>">
and I've tried the following which raises an error
%div(ng-controller='PollCtrl', ng-init='polls = @plan.polls.to_json %>')
Use like
%div{"ng-controller" => "PollCtrl", "ng-init" => "polls = #{@plan.polls.to_json} "}
Which will produce
<div ng-controller="PollCtrl" ng-init="polls = <%= @plan.polls.to_json %> ">
Tested int haml2erb.org