开发者

Can Abingo Test run on haml?

开发者 https://www.devze.com 2023-02-26 00:27 出处:网络
I am using Abingo to do ABtesting on my website. So it can generate different view开发者_如何学Cs as A and B. But all examples I find are using .erb, like this:

I am using Abingo to do ABtesting on my website. So it can generate different view开发者_如何学Cs as A and B. But all examples I find are using .erb, like this:

<% ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"], :conversion => "signup") do |signup_title| %>   <% title "Free Sign up" %> <% end %>

Can I use ABingo to switch views in .haml? If so, what syntax should I use?

Thanks a lot.


The conversion to HAML for your example is:

- ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"], :conversion => "signup") do |signup_title|   
  - title "Free Sign up"

I assume you as following the ABingo Railscast. Just be aware that these screencasts use the Nifty Layout generator and have a title method.

0

精彩评论

暂无评论...
验证码 换一张
取 消