Ruby on rails 将rails draper gem与angularjs和json一起使用
所以,我看到人们围绕这个话题跳舞,但我找不到答案。我刚刚安装了带导轨的“draper”宝石。这很好,但我希望能够与angularjs一起使用它。有办法吗?或者我需要用angularjs做一个肋骨装饰。。。。这意味着我的“德雷珀”宝石毫无用处:Ruby on rails 将rails draper gem与angularjs和json一起使用,ruby-on-rails,json,angularjs,draper,Ruby On Rails,Json,Angularjs,Draper,所以,我看到人们围绕这个话题跳舞,但我找不到答案。我刚刚安装了带导轨的“draper”宝石。这很好,但我希望能够与angularjs一起使用它。有办法吗?或者我需要用angularjs做一个肋骨装饰。。。。这意味着我的“德雷珀”宝石毫无用处: class PageDecorator < Draper::Decorator delegate_all def emphatic object.text.upcase end end <li class="gregli"
class PageDecorator < Draper::Decorator
delegate_all
def emphatic
object.text.upcase
end
end
<li class="gregli" ng-repeat="page in pages">
{{ page.text }}
</li>
def index
@pages = Page.all.decorate
render json: @pages
end